Skip to content

Commit 132ceb7

Browse files
committed
fix: make sure to always trigger on_closed senders
1 parent 2bc67cc commit 132ceb7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

quinn/src/connection.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,14 @@ impl Drop for State {
15671567
.endpoint_events
15681568
.send((self.handle, proto::EndpointEvent::drained()));
15691569
}
1570+
1571+
if !self.on_closed.is_empty() {
1572+
let reason = self.error.as_ref().expect("closed without error reason");
1573+
let stats = self.inner.stats();
1574+
for tx in self.on_closed.drain(..) {
1575+
tx.send((reason.clone(), stats.clone())).ok();
1576+
}
1577+
}
15701578
}
15711579
}
15721580

0 commit comments

Comments
 (0)