cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: SCP Breaks after some KB

From: Gavrie Philipson <gavrie_at_gmail.com>
Date: Wed, 31 Oct 2007 14:29:23 +0000 (UTC)

Daniel Stenberg <daniel <at> haxx.se> writes:

>
> On Sat, 22 Sep 2007, Marc Kannegiesser wrote:
>
> > I am currently trying to get curl (or libcurl, or curlpp-wrapper) to work in
> > my application. I try to transfer files using SCP which works pretty good.
> >
> > But there seems to be a problem when I transfer bigger files.
> >
> > This happens using curlpp (Wrapper for c++ around libcurl) and using the
> > commandline.
>
> What if you build and test the non-blocking SCP example(s) in the libssh2
> package, do they work?
>

Daniel,

I encountered the same problem; 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

I followed your 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):

ACC# ./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:

ACC# ./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...

-- Gavrie
Received on 2007-10-31