Ensure Connecting::handshake_data completes on connection errors

This commit is contained in:
Benjamin Saunders
2021-07-15 18:39:15 -07:00
committed by Dirkjan Ochtman
parent c8736e869b
commit 459f56973c
+3
View File
@@ -997,6 +997,9 @@ where
/// Used to wake up all blocked futures when the connection becomes closed for any reason
fn terminate(&mut self, reason: ConnectionError) {
self.error = Some(reason.clone());
if let Some(x) = self.on_handshake_data.take() {
let _ = x.send(());
}
for (_, writer) in self.blocked_writers.drain() {
writer.wake()
}