www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: Re: libssh2_sftp_read reads a number of bytes smaller than both the file size and the specified buffer size

Re: libssh2_sftp_read reads a number of bytes smaller than both the file size and the specified buffer size

From: Peter Stuge <peter_at_stuge.se>
Date: Tue, 3 Apr 2012 23:53:08 +0200

Daniel Stenberg wrote:
> On Tue, 3 Apr 2012, Adam Craig wrote:
>
>> If I upload a file of 200K all in one call to libssh2_sftp_write and it
>> returns 30K when it actually uploaded all 200K, what does the 30K return
>> value mean?
>
> It means 30K was sent off and that you need to call it again with the
> remaining 170K. In a very similar fashion to how write() and similar
> function calls work.

So _sftp_write() is different from _channel_write() here? It does not
need to be called again with the same data, when it reports some
success - only when it returns EAGAIN?

> Based on your questions, I figure we need to expand this to explain
> it with more detail!

Or maybe refer to some examples which show how to do it right.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-04-03

the libssh2 team