Skip to content

Report a lost SFTP connection instead of the server's last answer - #291

Merged
5cript merged 1 commit into
mainfrom
fix/sftp-stale-error-status
Nov 1, 2026
Merged

5cript merged 1 commit into
mainfrom
fix/sftp-stale-error-status

Conversation

@5cript

@5cript 5cript commented Nov 1, 2026

Copy link
Copy Markdown
Owner

SftpSession::lastError now reports SSH_FX_CONNECTION_LOST with the libssh session error once the SSH connection or the SFTP channel is closed. libssh keeps the status of the server's last answer when a read on a broken connection fails, so a connection dropped after a missing-file answer was reported as a missing file.

Adds SftpInStrandTests.ADroppedConnectionIsNotReportedAsTheLastAnswerOfTheServer.

@5cript
5cript merged commit f994762 into main Nov 1, 2026
3 checks passed
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.

1 participant