Subject: RE: LIBSSH2_SFTP_PACKET_MAXLEN

RE: LIBSSH2_SFTP_PACKET_MAXLEN

From: Michael Harris <michael.harris_at_ericsson.com>
Date: Mon, 14 Nov 2011 10:42:02 +0800

>> Does it still even if you double the amount of files in the directory?

>> It seems the server has a larger maximum packet size than libssh2 and we
>> should probably consider upping the limit for when we consider it a
>> problem.

We looked into openssh-4.3p2. For readdir, they read up to 100 filenames at a time and pack them all into a single packet (ie. the packet size is determined by how many bytes it takes to store 100 filenames). They do have a maximum size of 1MB but that will never be reached sending 100 filenames.

>> The check in question is only there to detect "unreasonable" packet sizes
>> so we could easily just bump the checked boundary and be fine with it.
>> The question is then only to which new value we should move it...

Yes. I've only been able to look into openssh. Other sftp servers might have different limits. I think this is a limitation in the sftp spec itself - it does not mandate a maximum packet size, and since the SSH_FXP_READDIR request does not include a read length, there is no way for the server to know what a reasonable length would be.

Regards // Mike

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-11-14