-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SFTP Server] Client hangs on exit #1443
Comments
We're facing the exact same issue. We haven't found any way to listen to the client disconnecting and force that disconnection. We also tried adding a lower limit for the keepalive timeout with no success. |
Managed to fix it. Had to dig into the code. Seems like the const session = accept()
+ session.on('end', () => {
+ // session can be undefined for clients other than `sftp`.
+ if (session) session.end()
+ })
session.on('sftp', (accept, reject) => {
...
}) |
What version are you using? I get an error that says edit: I assume 1.16.0, it's been out for a while. |
That's why I added that |
Wait, did you add it in the correct place maybe? This is before the Edit: our code pretty heavily deviates from the examples that's why I provided an excerpt |
Error:
|
Hmm interesting, now I see this too. Apparently the error caused the disconnection 😅 I'll investigate. |
Seems like closing the parent client ssh Edit: deploying now to our live server and testing that as well. |
Nice, that worked! Going to leave the issue open for now, since it's technically an issue with documentation/example code. Thanks for the help! |
I'm using a lightly modified version of the SFTP server example in the readme, along with the
REALPATH
logic from the SFTP example in theexamples
directory of this repo (found here). When I attempt to exit with this configuration, the server refuses to respond with an EOF after the client sends one.Client logs:
What I see:
What I expect to see:
Server Logs:
The text was updated successfully, but these errors were encountered: