Subject: Re: [PATCH] Honour window_size_initial from _libssh2_channel_read

Re: [PATCH] Honour window_size_initial from _libssh2_channel_read

From: Salvador Fandino <>
Date: Mon, 21 Oct 2013 17:56:03 +0200

On 10/18/2013 11:49 PM, Daniel Stenberg wrote:
> On Thu, 17 Oct 2013, Salvador Fandino wrote:
>> In summary, the conclusion I get from these results is that
>> LIBSSH2_CHANNEL_WINDOW_DEFAULT value should be increased to 1 or 2 MB.
> I can only agree. You up to making a patch with that change and parts of
> your great explanation here in the commit message to help future
> hackers? I think it makes sense to pick OpenSSH's default here.

Here is another run of patches.

I have gone a bit further and, besides increasing the default window
size to 2MB, I have also added two new slots into the session structure
channel_window_size and channel_packet_size that are used as the default
values for new channels.

The issue I try to avoid is that the window and packet sizes are not
always settable with the current API. I.e. they can not be set for
"tcp-ip" channels or for those created implicitly as for instance,
reverse tunnels.

The most controversial change is the way those new parameters are set as
I have added a new unified interface for setting/retrieving all the
session parameters "libssh2_session_config_(set|get)" and deprecated
"libssh2_session_flag" and
"libssh2_session_(set|get)_(timeout|blocking)". A more detailed
explanation is on the commit message.

The alternative would be to use a pair of functions to set/get every
parameter. I don't have a strong preference for one way or the other. My
only point is that the API should be consistent in the way those
accessors work.

In any case, IMO, patches 1 an 2 can be applied right now as they
implement changes we have already discussed.

Received on 2013-10-21