[Bug 1141] Is there a sound reason for MAX_MSG_LENGTH being 256KB?

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Jan 2 11:41:43 EST 2006


http://bugzilla.mindrot.org/show_bug.cgi?id=1141

           Summary: Is there a sound reason for MAX_MSG_LENGTH being 256KB?
           Product: Portable OpenSSH
           Version: 4.2p1
          Platform: ix86
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P4
         Component: sftp
        AssignedTo: bitbucket at mindrot.org
        ReportedBy: openssh-bugzill at r.paypc.com


This entry is entirely motivated by a curious entry in
http://winscp.net/eng/docs/history specifically, the following entry:

----->
Workaround for OpenSSH limit of 256 kB for size of SFTP packet. Consequence was
occasional interruption of transfer with error “Connection has been
unexpectedly closed. Server sent command exit status 11.”
<-----

I see the code in sftp-[client|server].c (the server's version doesn't
reference MAX_MSG_LENGTH, but rather uses a hard-coded 256 * 1024 -- perhaps
this should be patched in any event), but there was no explanatory text on the
part of the author.  I imagine it's probably set conservatively to avoid too
much memory pressure on the server-side.

I'm quite puzzled though that the maximum message isn't negotiated somehow,
though, as it seems unusually harsh to cause transfer faults if the message
size is too large.  Is WinSCP simply badly programmed, i.e., clients are meant
to double the message sizes until a supervisory error occurs and return to the
last successful message size?  

Would there be any significant risk impact to raising the maximum message size,
other than increased memory usage of course.  If I were to raise the maximum
message size in both the server/client, would unmodified OpenSSH clients have
connection problems when performing file transfers with these modified servers?

Thanks,
MB




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list