A sftp session failed with error "failure establishing ssh session"
on Solaris and HP-UX. Sometimes the first recv() function call
sets errno to ENOENT. In the man pages for recv of Solaris and
HP-UX the error ENOENT is not documented.
I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux.
--- src/misc.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/misc.c b/src/misc.c index 489605c..fefb497 100644 --- a/src/misc.c +++ b/src/misc.c @@ -108,8 +108,12 @@ _libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags) return -errno; } #else - if (rc < 0 ) - return -errno; + if (rc < 0 ){ + if ( errno == ENOENT ) + return -EAGAIN; + else + return -errno; + } #endif return rc; } -- 1.7.3.4 _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-develReceived on 2011-06-28