Repository navigation
Answer SFTP limits from the sandbox server - #86
Merged
Merged
Conversation
asyncssh's SFTP server answers limits@openssh.com from its own constants, a 4 MiB write, and never asks the SFTPServer. A client that honours the answer sends a file under 4 MiB as one write packet. The sandbox's OpenSSH sftp-server ends the session on a packet of 256 KiB or more, so every upload of that size failed with a lost connection. The backend now asks the sandbox server its limits after the handshake, and the gateway answers a caller's request with them. A sandbox server without the extension leaves the client's 16 KiB default in place. The test sftp-server resolves at the Debian path too, so the SFTP tests run on Linux instead of skipping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #85.
asyncssh's SFTP server answers
limits@openssh.comfrom its own constants, a 4 MiB write, and never asks theSFTPServer. A client that honours the answer, such as asyncssh 2.24 withputat its default block size, sends a file under 4 MiB as one write packet. The sandbox's OpenSSHsftp-serverends the session on a packet of 256 KiB or more, so every upload of that size failed withSFTPConnectionLost.Change
GatewaySFTPServer.limitsreturns that answer, and a caller'slimits@openssh.comrequest is routed to it beside the existing extension filter. A sandbox server without the extension leaves the client's 16 KiB default in place.Verification
uv run pytest: 857 passed.ruff check,ruff format --check,pyright: clean.