Subject: Re: writing to channel limited to 2 Mb?

Re: writing to channel limited to 2 Mb?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 11 Aug 2011 10:42:18 +0200 (CEST)

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
Received on 2011-08-11