Re: win32 patch for setting errno

2009-03-23 Thread Daniel Stenberg
On Mon, 23 Mar 2009, E L wrote: > I don't know what a suitable one would be. Right now, it appears the > libssh2 code only check for 0 and EAGAIN, all else are just handled > under generic errors. ... > Given how the code appears to work, EIO would be as good as any other code. Yeah, I just no

Re: win32 patch for setting errno

2009-03-23 Thread E L
>> I spoke too soon when I said the WSAENOTCONN should be converted to >> ENOTCONN.  ENOTCONN is not defined in win32. > > Please map the error onto another suitable win32 errno then. > I don't know what a suitable one would be. Right now, it appears the libssh2 code only check for 0 and EAGAIN,

Re: win32 patch for setting errno

2009-03-19 Thread Peter Stuge
E L wrote: > I spoke too soon when I said the WSAENOTCONN should be converted to > ENOTCONN. ENOTCONN is not defined in win32. Please map the error onto another suitable win32 errno then. //Peter -- Apps built with the

Re: win32 patch for setting errno

2009-03-19 Thread E L
> > Thanks. I did however remodel it somewhat to reduce code duplication and to > not use the wrapper functions for systems that don't need them (non-win32). > >> in two line libssh2_packet_read was not updated to _libsssh2_packet_read > > That's fine! > >> mingw compiler has unistd.h that defines

Re: win32 patch for setting errno

2009-03-19 Thread Daniel Stenberg
On Wed, 18 Mar 2009, E L wrote: > Here is a patch against libssh2-1.0.1-20090318.tar.gz that sets errno on > windows by defining a wrapper _libssh2_recv and _libssh2_send. I was not > sure where it should go, so I just put it in misc.c. Thanks. I did however remodel it somewhat to reduce code

Re: win32 patch for setting errno

2009-03-18 Thread crc1021
Peter Stuge wrote: > I mostly like it, but.. > > E L wrote: > > +case WSAENOTCONN: > > +case WSAECONNABORTED: > > +errno = WSAENOTCONN; > > +break; > > ..is it really wise to mix WSAE with E error codes? > No. That was part of the code that I moved, but

Re: win32 patch for setting errno

2009-03-18 Thread Peter Stuge
I mostly like it, but.. E L wrote: > +case WSAENOTCONN: > +case WSAECONNABORTED: > +errno = WSAENOTCONN; > +break; ..is it really wise to mix WSAE with E error codes? //Peter --