Skip to content

Commit 47d107a

Browse files
authored
Wake up connection when dropping SendRequest (#538)
Fixes #502
1 parent fea3ae6 commit 47d107a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/proto/streams/streams.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,14 @@ where
990990
P: Peer,
991991
{
992992
fn drop(&mut self) {
993-
let _ = self.inner.lock().map(|mut inner| inner.refs -= 1);
993+
if let Ok(mut inner) = self.inner.lock() {
994+
inner.refs -= 1;
995+
if inner.refs == 1 {
996+
if let Some(task) = inner.actions.task.take() {
997+
task.wake();
998+
}
999+
}
1000+
}
9941001
}
9951002
}
9961003

0 commit comments

Comments
 (0)