Hello everyone,

I was wondering if you could help me debug a problem I'm having when
using libssh2.  If I try to read a file using libssh2_sftp_read with a
small buffer (e.g. 4K) it works fine.  However, if I try to use a
large one (e.g. 6M - I think even 500K triggers the problem though)
the call fails and gives me the generic timeout-waiting-for-a-packet
error message.

I've tracked down the failure to a call to libssh2_sftp_packet_read
from the libssh2_sftp_packet_requirev function (line 371, sftp.c,
latest CVS).  Inside this call it fails with an "SFTP packet too
large" message (line 173).  (I've noticed that the packet_len is
0x67000000 (1728053248) but I'm not sure maybe that's relevant.)

Having traced the execution in the working case and compared it to the
failing case, the first difference I could identify was the call to
libssh2_sftp_packet_ask on line 359 returns -1 only in the failing
case.  This happens because packet (assigned on line 240) is null and
therefore the entire while loop starting at 263 is skipped.

Apologies for the brain-dump but I'm not familiar enough with libssh2
to explain *why* this is happening - just *what* is happening.  I hope
someone has a better idea of what's going on.

I've read elsewhere in the mailing list that libssh2_sftp_read should
be called with a buffer as big as the file itself in order to maximise
performance so I don't think I'm just calling it incorrectly.

My platform is:
Windows XP
Visual Studio 2005
A recent SDK
libssh2-CVS-HEAD linked with OpenSSL 0.9.8g

Connecting to:
Ubuntu Hardy/Intrepid
OpenSSH 5.1p1 linked with OpenSSH 0.9.8g

Your help is greatly appreciated
(and may contribute to a very useful piece of software for any Windows
users ;) )

Alex
Swish (http://swish.sourceforge.net)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to