It appears that the latest libssh2 code has a problem reading from
SFTP with a large buffer (in blocking mode). On Windows the
libssh2_sftp_read call fails with a "Timeout waiting for status
message" error when the buffer size goes above about 1500 bytes (YMMV)
though this is not consistent between calls. On linux, the call just
hangs at about 2500 bytes (YMMV, again) on a call to select():
select(4, , NULL, NULL, NULL) = 1 (in )
16384, MSG_NOSIGNAL) = 1408
select(4, NULL, NULL, NULL, NULL
Attached is the little test program I'm using. Invoke it like this:
./libssh2_bigread 18.104.22.168 username password reasonably_large_file
I can only reproduce the symptoms if the target file is on a *remote*
machine although, it may happen when connecting to localhost of your
machine is slow enough.
I was hoping to track down the cause a little better but haven't had
the time. All I know is it occurred somewhere between commit
6409bb53ba2fd937260caf1cb2cdbf40d782180c (post RELEASE 1.1), which
works, and the current master HEAD, which doesn't. I'll try and pin
this down a little more later.
Are any changes likely candidates for having caused this?
Received on 2009-08-04