On Thu, 11 Aug 2011, Przemysław Szczygielski wrote:

+            return (rc==LIBSSH2_ERROR_EAGAIN?rc:**0);

If I patch my version of libssh2 like above, should I use some additional magic to resolve this EAGAIN condition? Send some window adjustment packet, or whatever (sorry, I have no idea what I am talking about...) Or just wait until this EAGAIN goes away?

Are you using the API in a blocking or non-blocking way?

If blocking: the existing "wrapper functions" will detect the EAGAIN and wait for it to signal data to be readable accordingly.

If non-blocking: your code should already be prepared to handle EAGAIN and act accordingly when that happens => call libssh2_session_block_directions() to see what to wait for, then wait and then call libssh2 again when things happen.

Both cases: this patch should not change the way your application would work and you should not have to edit any code at all in your application.

--

 / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to