_libssh2_error: hide EAGAIN for non-blocking sessions

In an attempt to make the trace output less cluttered for non-blocking
sessions the error function now avoids calling the debug function if the
error is the EAGAIN and the session is non-blocking.
This commit is contained in:
Daniel Stenberg 2010-10-07 11:19:51 +02:00
parent 822f9e8689
commit 9887c01103

View File

@ -55,6 +55,10 @@ int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg)
session->err_msg = errmsg;
session->err_code = errcode;
#ifdef LIBSSH2DEBUG
if((errcode == LIBSSH2_ERROR_EAGAIN) && !session->api_block_mode)
/* if this is EAGAIN and we're in non-blocking mode, don't generate
a debug output for this */
return errcode;
_libssh2_debug(session, LIBSSH2_TRACE_ERROR, "%d - %s", session->err_code,
session->err_msg);
#endif