node: Use winpipe for control socket on Windows
As std::os::unix is obviously not available on Windows, resort to the
winpipe crate, which implements a very similar API for named pipes.
Apart from simple changes to imports, we need to jump through a few
hoops because the std::io::{Read, Write} impls are on &mut for
winpipe, thus yielding different mutability requirements on Unix vs.
Windows.
We resort to cloning, but as this fallible, swallow the added complexity of a platform-dependent implementation to not risk panics on Unix.
5 files changed
+75
-20
ce11f03f
→
19a262d3
modified Cargo.lock
@@ -2870,6 +2870,7 @@ dependencies = [
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified crates/radicle-node/Cargo.toml
@@ -51,6 +51,9 @@ thiserror = { workspace = true }
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/control.rs
@@ -2,11 +2,14 @@
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -30,7 +33,7 @@ pub enum Error {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -42,11 +45,11 @@ where
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -74,15 +77,56 @@ enum CommandError {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
|
|
| - | |
| - | |
|
|
|
|
|
@@ -241,7 +285,6 @@ fn fetch<W: Write, H: Handle<Error = runtime::HandleError>>(
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -257,7 +300,7 @@ mod tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -267,7 +310,7 @@ mod tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -305,7 +348,7 @@ mod tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/runtime.rs
@@ -1,10 +1,14 @@
|
|
|
|
|
|
| - | |
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -100,9 +104,9 @@ impl From<service::Error> for Error {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -313,7 +317,7 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -327,7 +331,7 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -348,7 +352,7 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified crates/radicle-node/src/runtime/handle.rs
@@ -1,9 +1,13 @@
|
|
| - | |
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -320,7 +324,7 @@ impl radicle::node::Handle for Handle {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|