_libssh2_channel_write: limit to 32700 bytes
The well known and used ssh server Dropbear has a maximum SSH packet length at 32768 by default. Since the libssh2 design current have a fixed one-to-one mapping from channel_write() to the packet size created by transport_write() the previous limit of 32768 in the channel layer caused the transport layer to create larger packets than 32768 at times which Dropbear rejected forcibly (by closing the connection). The long term fix is of course to remove the hard relation between the outgoing SSH packet size and what the input length argument is in the transport_write() function call.
This commit is contained in:
parent
7dd574c353
commit
b3d6c6567d
@ -1919,8 +1919,8 @@ _libssh2_channel_write(LIBSSH2_CHANNEL *channel, int stream_id,
|
||||
* assume the app will call it again with the rest! The 32K is a
|
||||
* conservative limit based on the text in RFC4253 section 6.1.
|
||||
*/
|
||||
if(buflen > 32768)
|
||||
buflen = 32768;
|
||||
if(buflen > 32700)
|
||||
buflen = 32700;
|
||||
|
||||
if (channel->write_state == libssh2_NB_state_idle) {
|
||||
channel->write_bufwrote = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user