cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl sftp shutdown error with MessageWay server

From: Matt Wixson <mwixson_at_ceclabs.com>
Date: Sun, 21 Mar 2010 10:29:21 -0400

I am attempting to download a file (any size, small or large) from an SFTP
server by MessageWay.com and cannot get a clean close after transfer. I
have tried several versions of curl and libssh2 including libcurl-7.20.0 and
libssh2-1.2.5-20100318. The same transfer works using OpenSSH/sftp, but
never with curl, libcurl and libssh2. Unfortunately, I do not have access
to the MessageWay SFTP server (version etc.) as it is hosted by a third
party.

The file is transferred completely, the file size on the client matches the
file size on the server, but the process hangs for several minutes and then
I receive an error from close. Both command line curl and my app using
libcurl return the same error:

curl: (56) Failure when receiving data from the peer:

Here is the trace/debug information from CURL and SSH2r:

trace output here...I see the complete file transfer

    PROCESS HANGS FOR A FEW MINUTES

== Info: SSH DISCONNECT starts now
== Info: SFTP 0x9714090 state change from SSH_STOP to SSH_SFTP_SHUTDOWN
== Info: Failed to close libssh2 file during shutdown: -30 (NOTE: I
appended "during shutdown" to this info message to determine which part of
the code it was in)
== Info: SFTP 0x9714090 state change from SSH_SFTP_SHUTDOWN to
SSH_SESSION_DISCONNECT
== Info: SFTP 0x9714090 state change from SSH_SESSION_DISCONNECT to
SSH_SESSION_FREE
== Info: SFTP 0x9714090 state change from SSH_SESSION_FREE to SSH_STOP
== Info: SSH DISCONNECT is done
== Info: Closing connection #0
== Info: Failure when receiving data from the peer

Any thoughts on how I can correct or avoid this issue? Why would
OpenSSH/sftp succeed but curl+libssh2 fail during the close? Any help is
appreciated!

Thanks,
Matt

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-21