Skip to content

Conversation

migueldeicaza
Copy link
Contributor

Currently SFTP's init will busy loop waiting for the channel to close, even if the underlying transport returns EAGAIN. While this works for sockets, it might not work out if you have a different transport that needs to do some additional processing on the side.

migueldeicaza and others added 2 commits July 12, 2022 16:18
…n, instead return to the caller, and close the connection at a later point
@vszakats vszakats requested a review from willco007 April 15, 2023 18:22
@vszakats vszakats added the bug label Apr 15, 2023
@vszakats
Copy link
Member

@libssh2/dev-team This is technically ready to merge. Any objection, opinion or review if we are good to go along with it?

@vszakats vszakats merged commit 33dddd2 into libssh2:master Apr 26, 2023
@vszakats
Copy link
Member

Thank you, merged now.

agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
libssh2#720)

Currently SFTP's init will busy loop waiting for the channel to close,
even if the underlying transport returns EAGAIN. While this works for
sockets, it might not work out if you have a different transport that
needs to do some additional processing on the side.

Integration-patches-by: Viktor Szakats
willco007 pushed a commit that referenced this pull request Sep 27, 2024
The `send_existing()` function allows partially sent packets to be sent
fully before any further packets are sent. Originally this returned
`LIBSSH2_ERROR_BAD_USE` when a different caller or thread tried to send
an existing packet created by a different caller or thread causing the
connection to disconnect. Commit 33dddd2 removed the return
allowing any caller to continue sending another caller's packet. This
caused connection instability as discussed in #1397 and confused the
client and server causing occasional duplicate packets to be sent and
giving the error `rcvd too much data` as discussed in #1431. We return
`LIBSSH2_ERROR_EAGAIN` instead to allow existing callers to finish
sending their own packets.

Fixes #1397
Fixes #1431
Related #720

Credit: klux21, rolag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants