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

Archive Index This month's Index

Subject: [SFTP] Is there a way to determine the maximum buffer len when reading.

[SFTP] Is there a way to determine the maximum buffer len when reading.

From: Velichko Yuriy <velichko.yuriy_at_gmail.com>
Date: Fri, 23 Aug 2013 00:47:41 +0300

Hello!

I tried to read data from file using function libssh2_sftp_read(3).

The buffer_maxlen = 8000

But the "Number of bytes actually populated into buffer" (the return value
of function) is always 2000.

The documentation says :

 libssh2_sftp_read(3) will attempt to read as much as possible however it
may not fill all of buffer if the file pointer reaches the end or if
further reads would cause the socket to block.

So the question: "2000" bytes is the limit of the "socket", or server, or
this is a limit established by the libssh2 library?

Can I determine this limit programmatically?

Of course if this is not available I will read data smallest blocks ( as
shown in the sftp example ).

Thanks!

-- 
Best Regards!

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

the libssh2 team