GNOME Bugzilla – Bug 711287
sftp backend should limit size of packets
Last modified: 2013-11-07 13:12:02 UTC
The sftp spec says read and write requests shouldn't be larger than 32768 but the sftp backend doesn't respect this.
Created attachment 258804 [details] [review] sftp: Limit requests to no more than 32768 bytes Reference: Chapter 3 of http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt http://daniel.haxx.se/blog/2010/12/08/making-sftp-transfers-fast/
Review of attachment 258804 [details] [review]: Patch looks good, however there is written: All servers SHOULD support packets of at least 34000 bytes (where the packet size refers to the full length, including the header above). This should allow for reads and writes of at most 32768 bytes. So I think 32768 bytes isn't allowed maximum, but supported minimum. Don't know how to limit our sshd server packet size or increase gvfs buffer_size to test it, but the backend should work also when we requested more and it should simply read less then we requested, however may not work for writing and returns error... Do you prove it somehow?
After reading it again, it says: "The maximum size of a packet is in practice determined by the client" so let's leave it at 64kb until someone finds a server which doesn't like packets of that size.