Subject: [libssh2] Transferring large files with SCP fails

[libssh2] Transferring large files with SCP fails

From: Gavrie Philipson <gavrie_at_gmail.com>
Date: Thu, 1 Nov 2007 13:17:27 +0000 (UTC)

Hi,

I'm trying to transfer large files with the SCP protocol, using cURL together
with libssh2.

My curl SCP transfer hangs after 192 kB:

$ curl -T /tmp/1 scp://test:test_at_192.168.240.1/tmp/1
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 192k 0 0 0 192k 0 30399 --:--:-- 0:00:06 --:--:-- 0

Following up on this thread on the cURL mailing list:
http://news.gmane.org/find-root.php?group=gmane.comp.web.curl.general&article=8052

I followed Daniel's suggestion, and ran the 'scp' and 'scp_nonblock' examples.

The 'scp' example works on a small file, but fails on a big one (6 MB):

$ ./scp 127.0.0.1 root **** /tmp/bigfile >/dev/null
Fingerprint: ...
libssh2_channel_read() failed: 583
all done

The 'scp_nonblock' example hangs after a while:

$ ./scp_nonblock 127.0.0.1 root **** /tmp/bigfile >/dev/null
Fingerprint: ...
libssh2_scp_recv()!
libssh2_scp_recv() is done, now receive data!

Running strace on it shows a bunch of these lines:

select(4, [3], [3], NULL, {10, 0}) = 1 (in [3], left {10, 0})
recv(3, 0x804a5a4, 4096, 0x4000) = -1 EAGAIN (Resource temporarily
unavailable)
select(4, [3], [3], NULL, {10, 0}) = 1 (in [3], left {10, 0})
recv(3, 0x804a5a4, 4096, 0x4000) = -1 EAGAIN (Resource temporarily
unavailable)

For completeness I'll add that the regular command line 'scp' utility (from
OpenSSH) works perfectly on this system.

Any help would be appreciated...

I tested this also on the latest snapshot (libssh2-0.18.0-20071031).

-- Gavrie

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-11-01