Subject: Re: libssh2_sftp_seek64 doesn't work

Re: libssh2_sftp_seek64 doesn't work

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Fri, 26 Aug 2011 20:52:12 +0200

fre 2011-08-26 klockan 18:50 +0100 skrev Alexander Lamaison:

> Howso? Can't all functions return E_AGAIN at which point the caller
> might choose to abort (i.e. not call the function again, possibly
> calling a different function later)?

If EAGAIN is returned then you need to keep calling that function with
the exact same arguments after the blocking condition have been
fulfilled.

Internal state will be messed up if you do not, and in some cases the
transport will jam completely (when EAGAIN is returned due to transport
congestion).

About the only exception is libssh2_channel_read() which also reports
EAGAIN when there simply is no data available to read in the channel at
the moment.

Regards
Henrik

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-08-26