Subject: Re: [PATCH] Send internal packet priority

Re: [PATCH] Send internal packet priority

From: liuzl <>
Date: Fri, 9 Sep 2011 09:52:14 +0800

 My fault, I don't see the source code when i am at home last night.
 I have test your patch, the problem still exists.

In the function _libssh2_channel_receive_**window_adjust() there's a call to
> _libssh2_transport_send(). If this transport function returns EAGAIN, then
> that will be returned from the receive window function. All other errors
> will cause a LIBSSH2_ERROR_SOCKET_SEND to get returned.
 Yes, the return code of _libssh2_channel_receive_**window_adjust() is
because we are blocking in the last call. then function
_libssh2_channel_read() will ignore LIBSSH2_ERROR_SOCKET_SEND, set
  channel->read_state = libssh2_NB_state_created;
 In the next call to _libssh2_channel_read() ,this will occur again because
we are blocking again in previous _libssh2_channel_write(). .
 The receiving-window-adjust packet has no chance to be sent.
 In my first patch for this problem i send the receiving-window-adjust
packet in _libssh2_channel_write(), the packet can be sent before
 we are blocking, see:

Second, if _libssh2_channel_receive_window_adjust() return EAGAIN, caller
will get a big problem.
We will lose data we have just read from session->packets. In the next call
to sftp_packet_read() we will get an

Received on 2011-09-09