@@ -373,7 +373,7 @@ impl Connection {
373
373
}
374
374
}
375
375
Ok ( ( path_id, _) ) => {
376
- let ( tx, rx) = watch:: channel ( None ) ;
376
+ let ( tx, rx) = watch:: channel ( Ok ( ( ) ) ) ;
377
377
state. open_path . insert ( path_id, tx) ;
378
378
drop ( state) ;
379
379
OpenPath :: new ( path_id, rx, self . 0 . clone ( ) )
@@ -385,7 +385,7 @@ impl Connection {
385
385
/// Opens a (Multi)Path
386
386
pub fn open_path ( & self , addr : SocketAddr , initial_status : PathStatus ) -> OpenPath {
387
387
let mut state = self . 0 . state . lock ( "open_path" ) ;
388
- let ( on_open_path_send, on_open_path_recv) = watch:: channel ( None ) ;
388
+ let ( on_open_path_send, on_open_path_recv) = watch:: channel ( Ok ( ( ) ) ) ;
389
389
let now = state. runtime . now ( ) ;
390
390
let open_res = state. inner . open_path ( addr, initial_status, now) ;
391
391
state. wake ( ) ;
@@ -1096,7 +1096,7 @@ pub(crate) struct State {
1096
1096
/// Always set to Some before the connection becomes drained
1097
1097
pub ( crate ) error : Option < ConnectionError > ,
1098
1098
/// Tracks paths being opened
1099
- open_path : FxHashMap < PathId , watch:: Sender < Option < Result < ( ) , PathError > > > > ,
1099
+ open_path : FxHashMap < PathId , watch:: Sender < Result < ( ) , PathError > > > ,
1100
1100
/// Tracks paths being closed
1101
1101
pub ( crate ) close_path : FxHashMap < PathId , oneshot:: Sender < VarInt > > ,
1102
1102
pub ( crate ) path_events : tokio:: sync:: broadcast:: Sender < PathEvent > ,
@@ -1266,7 +1266,7 @@ impl State {
1266
1266
Path ( ref evt @ PathEvent :: Opened { id } ) => {
1267
1267
self . path_events . send ( evt. clone ( ) ) . ok ( ) ;
1268
1268
if let Some ( sender) = self . open_path . remove ( & id) {
1269
- let _ = sender . send ( Some ( Ok ( ( ) ) ) ) ;
1269
+ sender . send_modify ( |value| * value = Ok ( ( ) ) ) ;
1270
1270
}
1271
1271
}
1272
1272
Path ( ref evt @ PathEvent :: Closed { id, error_code } ) => {
@@ -1281,7 +1281,7 @@ impl State {
1281
1281
Path ( ref evt @ PathEvent :: LocallyClosed { id, error } ) => {
1282
1282
self . path_events . send ( evt. clone ( ) ) . ok ( ) ;
1283
1283
if let Some ( sender) = self . open_path . remove ( & id) {
1284
- let _ = sender . send ( Some ( Err ( error) ) ) ;
1284
+ sender . send_modify ( |value| * value = Err ( error) ) ;
1285
1285
}
1286
1286
// this will happen also for already opened paths
1287
1287
}
0 commit comments