Commit 2d3d0b4
authored
perf: raise server MAX_READ_SIZE to SFTP standard 255 KiB (#197)
The bssh-server hard-capped every SFTP `READ` reply at 64 KiB
(`MAX_READ_SIZE = 65536`) regardless of what the client requested.
`bssh-russh-sftp` and OpenSSH's `sftp-server` both use the SFTP standard
`MAX_READ_LENGTH = 261120` (255 KiB) for request sizing, so a client
asking for a 256 KiB chunk only ever got 64 KiB back, forcing it to
issue four extra requests for the same byte stream.
Bump `MAX_READ_SIZE` to `261120` so server replies match the standard
chunk size used by the rest of the stack. Combined with client-side
pipelining (#196), this directly cuts the per-MiB request count on
downloads from 16 → 4.
Memory exposure stays bounded: handles are still capped at
`MAX_HANDLES = 1000` per session and each in-flight read still uses
a single per-request buffer of this size (max ~255 KiB × in-flight
requests).1 parent 487301c commit 2d3d0b4
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
169 | 176 | | |
170 | 177 | | |
171 | 178 | | |
| |||
0 commit comments