Subject: Re: Using libssh2 1.4.3 is creating corrupt files.

Re: Using libssh2 1.4.3 is creating corrupt files.

From: <>
Date: Mon, 21 Oct 2013 08:52:01 -0400

Buffer size change (we have no idea what the 33 was for, but it was
probably required in the old version)
-#define WRITEBUFFERSIZE (1024*32)-33
+#define WRITEBUFFERSIZE 1024*128

Behavior wasn't reproducible when I moved the code, it instead 'hung' at a
different part of the file transfer (in terms of bytes). Haven't tried
putting it in a separate application yet. As it won't reproducible
independently, we haven't been able to test if there is some magic file
size that causes the problem.

We're using Windows, server is Tectia on Windows.
The application was compiled on a 32 bit Windows XP machine using Builder

We also switched from openssl to libgcrypt when we migrated from 1.2.7 to

This happens across multiple client/server environments with differing
amounts of RTT, but here it is essentially negligible.

From: Daniel Stenberg <>
To: libssh2 development <>
Date: 10/19/2013 05:24 PM
Subject: Re: Using libssh2 1.4.3 is creating corrupt files.
Sent by: "libssh2-devel" <>

On Fri, 18 Oct 2013, wrote:

> Before using 1.4.3 we were able to send 180MB files through FTP
> with no problems using 1.2.7. Since upgrading to 1.4.3, we have had
> of ftp receiving corrupt files. Our solution was to increase the buffer
> size to 10MB solved this problem, but we want to understand why this is
> happening.

Wow, that sounds so... unexpected. You increased the buffer from which
And did you check to see if there's a magic limit exactly where the

Can you write up a test code and show us that breaks for you? On what
operating system are you using libssh2? Which crypto backend are you using?

How's the RTT to the server, roughly?

Any chance you can try out the latest git version just to make sure the
problem hasn't been fixed already?

Received on 2013-10-21