Subject: Re: llibssh2 may drop data packets beyond receive window

Re: llibssh2 may drop data packets beyond receive window

From: Daniel Stenberg <>
Date: Fri, 27 Mar 2015 08:35:24 +0100 (CET)

On Thu, 26 Mar 2015, Gilbert (Gang) Chen wrote:

> Recently I found out that libssh2 may drop some data packets, which
> presents a serious problem for rsync because the data stream becomes
> corrupted and the error is irrecoverable. I traced that down to a place in
> packet.c where it says "The current receive window is full, data ignored".
> The root cause of this error is still unknown (the server side could have
> miscalculated the window size), but is it the right decision to drop packets
> under this circumstance, even if the Spec said so?

Perhaps not, but then if the remote doesn't adhere to the limits where do we
draw the line?

The times we have seen this happen in the past it has been due to some sort of
broken server.

> I think keeping all data packets regardless of the receive window size would
> make libssh2 more resilient to bugs.

Resiliance to bad behavior however is not necessarily a good thing. It is
better to fail early and hard then. So how can we tell which kind it is?

Received on 2015-03-27