Subject: Re: win32 patch for setting errno

Re: win32 patch for setting errno

From: E L <crc1021_at_gmail.com>
Date: Mon, 23 Mar 2009 08:00:34 -0500

>> 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, all else are just handled
under generic errors. For example, in session.c there is this:
        if (rc == PACKET_EAGAIN) {
            return LIBSSH2_ERROR_EAGAIN;
        } else if (rc) {
            return LIBSSH2_ERROR_SOCKET_DISCONNECT;
        }

Given how the code appears to work, EIO would be as good as any other
code. However, if in the future the library returns more specific
reasons for errors, or does different retries based on the errors,
then something different would be needed, possibly like how curl
handles it: by defining (and sometimes redefining) all the socket
error codes to the the WSA codes in a header file.

Eric

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2009-03-23