Subject: libssh2_sftp_write blocks for about 3 minutes

libssh2_sftp_write blocks for about 3 minutes

From: Jerome Zimmermann <>
Date: Fri, 27 Oct 2017 15:13:32 +0200

Hi list,

we have the behavior that if the connection gets lost during
the SFTP data transfer the application than remains for
about 3 minutes in the send routine (function 'libssh2_sftp_write').
During this time the CPU usage remains at around 100 %.

The application is using the same send mechanism as
described in the example 'sftp_write_sliding.c'.

The last error message is: "Unable to send channel data" with error 'LIBSSH2_ERROR_SOCKET_SEND'.

Further, the session is using the blocking mode.

We have this behavior with libssh2 version 1.4.3 and libssh2 version 1.8.0.

But why does the blocking time take so long?

Do you have an idea?

Best regards


Received on 2017-10-27