[Bug 2949] New: "limits at openssh.com" extension to SFTP to query various transfer limits

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sat Dec 29 21:19:31 AEDT 2018


            Bug ID: 2949
           Summary: "limits at openssh.com" extension to SFTP to query
                    various transfer limits
           Product: Portable OpenSSH
           Version: -current
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: sftp-server
          Assignee: unassigned-bugs at mindrot.org
          Reporter: vapier at gentoo.org

Created attachment 3218
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3218&action=edit

i haven't been able to find any prior art in this space.  if anyone is
familiar with a server/client implementing a relevant extension, feel
free to highlight it.

`sftp` has a -B option to set the transfer buffer size.  this applies
to both read & write SFTP packets.

when doing a read of a really large size, OpenSSH will respond with
short reads.  e.g. if you request 1MiB, the server will just respond
with 64KiB (sftp-server.c:process_read hardcodes buf[64*1024]).  this
leaves the client with expecting to chunk things up at one size, but
ends up having to backfill things dynamically.  the client is able to
recover though, so that's good.

when doing a write of a really large size, OpenSSH will just close the
connection as soon as it sees the header with the large write.  the
server hardcodes 256KiB (SFTP_MAX_MSG_LENGTH) and any attempt to write
anything larger than that is immediately rejected.  this is not
friendly and clients basically have to default to 32KiB all the time
and force users to manually select a size that they happen to know the
server they're connecting to supports.

if the server supports an extension to dynamically query the exact
limits the server imposes, the client can start with the 32KiB default,
and then automatically increase to something with better throughput.

You are receiving this mail because:
You are watching the assignee of the bug.

More information about the openssh-bugs mailing list