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: Wed, 4 Apr 2012 03:44:19 +0200

Adam Craig wrote:
> > In short, just forget about what has actually arrived at the server
> > and pretend libssh2_sftp_write is telling the truth.
>
> Thank you. That makes sense. I will do as you suggest. This would
> be a good thing to explain in the documentation for the function.

I do not understand why anyone would want to do anything else.

> That still does not explain why the file downloads in 2K chunks,
> but that might have something to do with the server. I will try
> a different server-side program as soon as I can set up one.

You will find it difficult to find many other SFTP servers than
OpenSSH, but it's not a bad idea to try some different versions.
The newer the better, of course.

Also, you can build libssh2 with debug logging, and call
libssh2_trace(session, ~0); in order to get lots of debug output,
which among other things will show exactly what the server is
sending.

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