This month's Index
Subject: RE: LIBSSH2_SFTP_PACKET_MAXLEN
From: Michael Harris <michael.harris_at_ericsson.com>
Date: Sat, 19 Nov 2011 08:03:21 +0800
>> I think this is a limitation in the sftp spec itself - it does not mandate a
If you are referring to the section I quoted when I started this thread (Section 4 - General Packet Format) - that only states that a server SHOULD accept at least 34000 bytes. It says nothing about the minimum a client should accept or the maximum a server can send.
It also says:
The maximum size of a packet is in practice determined by the
This is true for normal reads and writes because the client specifies how many bytes are being written and read. Not true for directory reads where it is completely up to the server.
Also in this thread Henrik mentioned that there is maximum packet size negotiation at the channel level - that is correct but there is nothing to say that an SFTP layer packet needs to fit in a channel packet (and they don't - in my tests I can see multiple transport and connection packets being combined to make single SFTP packets).
So I stand by my original statement. Having said that I am sure I don't know as much about sftp as you guys so I'm ready to stand corrected.
It's probably handy to know the maximum packet length since it affects the efficiency of reads and writes (or so the API docs say).
Regards // Mike