-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Implement detached signal sender #56
base: master
Are you sure you want to change the base?
Conversation
1772198
to
6413886
Compare
Isn't this something that can be solved with let channel = ...
let (tx, rx) = mpsc::channel(1);
loop {
tokio::select! {
msg = channel.wait() => ...
sig = rx.recv() => channel.signal(sig)
}
}
...
tx.send(Sig::...) |
Not really, because I do not want to hold a My usecase is a map of signal senders that I can use to interrupt open connections on demand (orchestration platform). |
You don't need to hold the ref for that - the ref can stay in the |
Yeah, this is the ref I was talking about. It's honestly easier to have the channel return me a (scoped) sender directly than to have to create a layer of indirection that does the same thing. |
Can't merge this as it's a band-aid fix for one specific method that will eventually lead to duplication of every channel method. However I'm open to adding a Let me know if this is something you'd like to work on, otherwise I'll see if I can find time for it in the future. |
e803532
to
7b12f66
Compare
OpenSSH server sends `CHANNEL_WINDOW_ADJUST` messages before window_size is 0. Handle these message at each turn of the loop within `Channel.send_data` Signed-off-by: Joe Grund <[email protected]>
This reverts commit 52e5eaa.
…ead_authenticated() method
…ending the session
Bumps the dependency to at least 4.1.3 as per the advisory [Advisory](https://rustsec.org/advisories/RUSTSEC-2024-0344.html) (even though this crate may not be using the function mentioned in the advisory, it is better to bump it to ensure that there is no chance of other dependencies pulling it)
It seems like the project ended up with two different dependencies providing access to the home directory. This PR consolidates these dependencies into a single dependency. I've done so by using the `home` crate since on linux it has 0 dependencies and is well supported due to being a part of the cargo repo. But if you'd prefer I could swap this PR to use `dirs-next`. I would like to avoid `dirs` since it is pulling in strange dependencies dirs-dev/dirs-sys-rs#26
…f untrusted packet size
…eny#312) I left a `// NEED HELP` comment on places where I didn't fully figure out what to do, so I'd really appreciate it if some maintainers helped me out in those places. --------- Co-authored-by: Eugene <[email protected]>
…y#328) Apologies. I accidentally left a stray dbg!() in when checking the glob expansion logic of hosts in the russh-config SSH config parsing code. This PR simply removes it. Co-authored-by: Adam Chappell <[email protected]>
…the more specific error type when connection fails during kex phase
Allow signals to be sent detached from the channel struct. This is done using a higher-order function and by cloning the sender so it can be used independently of the `Channel`. This is useful to be able to spawn a cancelation handler separately from the main `Channel` recieve loop. Signed-off-by: Joe Grund <[email protected]> f08f74 Signed-off-by: Joe Grund <[email protected]>
2b289c2
to
34771f4
Compare
Allow signals to be sent detached from the channel struct.
This is done using a higher-order function and by cloning the sender so it can be used independently of the
Channel
.This is useful to be able to spawn a cancelation handler separately from the main
Channel
recieve loop.Signed-off-by: Joe Grund [email protected]