Subject: Re: SCP random size problem

Re: SCP random size problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Aug 2010 00:21:19 +0200 (CEST)

On Sun, 1 Aug 2010, vicent roca daniel wrote:

> I've a little problem though with scp.
>
> I'm using the same code in the examples, but I'm getting random size on the
> destination file. When I send a file, sometimes the file it's transfered ok,
> and other times not (incomplete) żAny clues?

I just checked, and the example/scp.c is wrong in as it seems to assume that
libssh2_channel_read() will always return the full amount of data, while in
reality it is made to never return MORE data than requested but may very well
return less (and even 0 is not an error).

I've fixed this example code now and pushed my commit.

-- 
  / daniel.haxx.se

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-08-02