From 47d107aa174a4186ea02491b8852329e3e63e572 Mon Sep 17 00:00:00 2001 From: Anthony Ramine <123095+nox@users.noreply.github.com> Date: Thu, 6 May 2021 20:57:44 +0200 Subject: [PATCH] Wake up connection when dropping SendRequest (#538) Fixes #502 --- src/proto/streams/streams.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/proto/streams/streams.rs b/src/proto/streams/streams.rs index c694203..8606654 100644 --- a/src/proto/streams/streams.rs +++ b/src/proto/streams/streams.rs @@ -990,7 +990,14 @@ where P: Peer, { fn drop(&mut self) { - let _ = self.inner.lock().map(|mut inner| inner.refs -= 1); + if let Ok(mut inner) = self.inner.lock() { + inner.refs -= 1; + if inner.refs == 1 { + if let Some(task) = inner.actions.task.take() { + task.wake(); + } + } + } } }