calling functions to support that with the following API notes:
* libssh2_publickey_shutdown(), libssh2_session_free() changed
to return an "int" to allow signaling of LIBSSH2_ERROR_EAGAIN.
* libssh2_scp_recv(), libssh2_scp_send_ex() and libssh2_sftp_init()
will loop in on libssh2_channel_free() when there is an error.
It is not possible to return LIBSSH2_ERROR_EAGAIN in this condition
in these 3 functions and not lose the original error code.
non-blocking mode. All functions either return
LIBSSH2_ERROR_EAGAIN or return NULL and set the error code
to be LIBSSH2_ERROR_EAGAIN instead of blocking, when in
non-blocking mode.
Functions that return an "int", and friends, return LIBSSH2SFTP_EAGAIN.
Functions that return a structure return NULL and set the error to
LIBSSH2_ERROR_EAGAIN
all the way up to the user interface. All code modules bug sftp.c have
been completed.
Functions that return an "int", or similar return LIBSSH2CHANNEL_EAGAIN to
indicate some part of the call would block, in non-blocking mode.
Functions that return a structure, like "LIBSSH2_CHANNEL *", return NULL
and set the libssh2 error. The error can be obtained with either
libssh2_session_last_error() or libssh2_session_last_errno(). Either of
these will return the error code of LIBSSH2_ERROR_EAGAIN if the
call would block, in non-blocking mode.
The current state of a function and some variable are keep in the
structures so that on the next call the operation that would block can
be retried again with the same data.
return an error. "errno" should have been zero by the recv() call but
doesn't seem to be on all systems. Only check when recv() says there
is an error.
Bug: 1703467
Patch: 1703468
the recent commits converted the tabs to 4 spaces, which matched the
initial indent size. Other commits converted the tabs to 8 spaces, this
didn't match.
All the code has been converted to 4 space indents. No changes to line
lengths or actual code was performed. This is in preperation to my up
coming non-blocking work so my commits should only be code changes and
line lengths in the code I am working on.