-
Notifications
You must be signed in to change notification settings - Fork 12
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
Be able to stop the server via a Lwt_switch.t
#52
Conversation
This PR adds a new argument to the Awa_mirage.spawn_server. The switch permits to the user to stop the server by a simple Net_eof signal catched by the nexus (the main loop) function. It probably closes abruptely the connection.
Lwt_switch.t
Hi, does it means that a distant user will shutdown the server when closing its connexion? I hope it's deactivable, at least for my sshfs server ;) |
Yes, this PR adds just the ability, for the server side, to close the connection if the implementer wants to close the connection (for whatever reason) but the default behavior is the same as before - keep the connection open as long as the client wants. |
At a first glance it looks good to me. I would need to study the code a bit more. Particularly, I am curious
|
I don't think that
The advantage of the Lines 265 to 266 in a9091a9
It's why I said that I probably close abruptely the connection. Indeed, some threads can still exists and they probably want to send few more bytes but I did not find a really nice way to close the connection on the server side. However, I think that we probably send |
Thanks for your PR. To rephrase: the API extension allows an application (client of the API) to close the SSH session. Previously, any application providing a SSH server would not be able to initiate a CLOSE (but required the SSH client to close the connection). Did I understand this correctly? Please correct me if I'm wrong.
No, there's nothing that shuts down the server. It only allows an application (such as your sshfs) to tell a client that the connection is closed, but other connection are not affected. To me, this PR looks fine. |
CHANGES: * server: be able to stop using a Lwt_switch.t (mirage/awa-ssh#52 @dinosaure) * server: add Pty/Set_env/Start_shell events (mirage/awa-ssh#53 @dinosaure) * client: support password authentication and keyboard-interactive (mirage/awa-ssh#51 @hannesm, reported by @dgjustice mirage/awa-ssh#31) * client: add NIST EC curves (mirage/awa-ssh#31 @hannesm) * client: try public key authenticaion only once (mirage/awa-ssh#50 @reynir @hannesm) * remove (partially implemented) hostbased authentication (mirage/awa-ssh#31 @hannesm) * replace deprecated Cstruct.copy by Cstruct.to_string (mirage/awa-ssh#53 @dinosaure) * remove ppx_cstruct and sexplib dependencies (mirage/awa-ssh#54 @hannesm)
This PR adds a new argument to the Awa_mirage.spawn_server. The switch permits to the user to stop the server by a simple Net_eof signal catched by the nexus (the main loop) function. It probably closes abruptely the connection
/cc @hannesm, @reynir