File tree Expand file tree Collapse file tree 3 files changed +25
-19
lines changed Expand file tree Collapse file tree 3 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -35,17 +35,17 @@ nix = "0.29"
35
35
oci-spec = " 0.6"
36
36
os_pipe = " 1.1"
37
37
prctl = " 1.0.0"
38
- prost = " 0.12 "
39
- prost-build = " 0.12 "
40
- prost-types = " 0.12 "
38
+ prost = " 0.13 "
39
+ prost-build = " 0.13 "
40
+ prost-types = " 0.13 "
41
41
serde = { version = " 1.0" , features = [" derive" ] }
42
42
serde_json = " 1.0"
43
43
simple_logger = { version = " 5.0" , default-features = false }
44
44
tempfile = " 3.6"
45
45
thiserror = " 1.0"
46
46
time = { version = " 0.3.29" , features = [" serde" , " std" , " formatting" ] }
47
47
tokio = " 1.26"
48
- tonic = " 0.11 "
49
- tonic-build = " 0.11 "
48
+ tonic = " 0.12 "
49
+ tonic-build = " 0.12 "
50
50
tower = " 0.4"
51
51
uuid = { version = " 1.0" , features = [" v4" ] }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ name = "version"
23
23
path = " examples/version.rs"
24
24
25
25
[dependencies ]
26
+ hyper-util = " 0.1.6" # https://github.com/hyperium/hyper/issues/3110
26
27
prost.workspace = true
27
28
prost-types.workspace = true
28
29
tokio = { workspace = true , optional = true }
Original file line number Diff line number Diff line change @@ -86,23 +86,28 @@ pub async fn connect(
86
86
87
87
let path = path. as_ref ( ) . to_path_buf ( ) ;
88
88
89
- // Taken from https://github.com/hyperium/tonic/blob/eeb3268f71ae5d1107c937392389db63d8f721fb /examples/src/uds/client.rs#L19
89
+ // Taken from https://github.com/hyperium/tonic/blob/71fca362d7ffbb230547f23b3f2fb75c414063a8 /examples/src/uds/client.rs#L21-L28
90
90
// There will ignore this uri because uds do not use it
91
91
// and make connection with UnixStream::connect.
92
- let channel = Endpoint :: try_from ( "http://[::]" )
93
- . unwrap ( )
92
+ let channel = Endpoint :: try_from ( "http://[::]" ) ?
94
93
. connect_with_connector ( tower:: service_fn ( move |_| {
95
- #[ cfg( unix) ]
96
- {
97
- tokio:: net:: UnixStream :: connect ( path. clone ( ) )
98
- }
99
-
100
- #[ cfg( windows) ]
101
- {
102
- let client = tokio:: net:: windows:: named_pipe:: ClientOptions :: new ( )
103
- . open ( path. clone ( ) )
104
- . map_err ( |e| std:: io:: Error :: from ( e) ) ;
105
- async move { client }
94
+ let path = path. clone ( ) ;
95
+
96
+ async move {
97
+ #[ cfg( unix) ]
98
+ {
99
+ Ok :: < _ , std:: io:: Error > ( hyper_util:: rt:: TokioIo :: new (
100
+ tokio:: net:: UnixStream :: connect ( path) . await ?,
101
+ ) )
102
+ }
103
+
104
+ #[ cfg( windows) ]
105
+ {
106
+ let client = tokio:: net:: windows:: named_pipe:: ClientOptions :: new ( )
107
+ . open ( path)
108
+ . map_err ( |e| std:: io:: Error :: from ( e) ) ;
109
+ client. await
110
+ }
106
111
}
107
112
} ) )
108
113
. await ?;
You can’t perform that action at this time.
0 commit comments