Skip to content

Conversation

@tomaswolf
Copy link
Member

In certain circumstances SftpOutputStreamAsync.flush() could cause sending an SSH_FXP_WRITE with zero data bytes. While this is not forbidden in SFTP, it is unnecessary and there is at least one SFTP server that (erroneously) rejects such zero-byte writes with an SSH_FX_BAD_MESSAGE error.

Ensure that SftpOutputStreamAsync does not produce such extra zero-byte writes.

Fixes #861.

In certain circumstances SftpOutputStreamAsync.flush() could cause
sending an SSH_FXP_WRITE with zero data bytes. While this is not
forbidden in SFTP, it is unnecessary and there is at least one SFTP
server that (erroneously) rejects such zero-byte writes with an
SSH_FX_BAD_MESSAGE error.

Ensure that SftpOutputStreamAsync does not produce such extra zero-byte
writes.
@tomaswolf tomaswolf merged commit 32038f1 into apache:master Jan 2, 2026
7 checks passed
@tomaswolf tomaswolf deleted the gh-861 branch January 2, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Throwing a SSH_FX_BAD_MESSAGE exception when file_size % 32726 = 0

1 participant