Subject: RE: libssh2_sftp_write doesn't hang anymore

RE: libssh2_sftp_write doesn't hang anymore

From: Daniel Stenberg <>
Date: Fri, 12 Nov 2010 22:12:11 +0100 (CET)

On Fri, 12 Nov 2010, Mark Riordan wrote:

> I did that, and ran it, and put the results here:

Okej, the executive summary is this table:

   Transferred 0.114 MB
   Final tot_libssh2_send=15707099
   put took 2.281 seconds = 0.050 MB/sec

These are really useful details and they show that things are terribly wrong!

I'm first focusing on "tot_libssh2_send=15707099" as it shows the problem is
present in the lowest possible layer within libssh2.

For this to be able to happen, I'm thinking there's something wrong with the
EAGAIN detection for win32 and I've just now remade how it is handled:
previously we would convert from the win32 error to the errno value and store
that in errno to allow the parent function to read it.

Starting now, we only use the _libssh2_recv and _libssh2_send functions and
they simply return the negative errno value on errors so that we don't ever
have to store anything in errno for win32 but only return the correct value.

Commit ca2e81eb1f1bcb3 was just pushed with this change.

Received on 2010-11-12