From 8ac81cbf93346127fd5a8fd5fdd57580496e63f7 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Sun, 7 Apr 2024 23:17:04 +0530 Subject: [PATCH] fix: v5 doesn't write outgoing packets onto network https://github.com/bytebeamio/rumqtt/pull/825#issuecomment-2041392647 --- rumqttc/src/v5/eventloop.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rumqttc/src/v5/eventloop.rs b/rumqttc/src/v5/eventloop.rs index ab1edb17c..1f7ee3944 100644 --- a/rumqttc/src/v5/eventloop.rs +++ b/rumqttc/src/v5/eventloop.rs @@ -209,7 +209,9 @@ impl EventLoop { self.options.pending_throttle ), if !self.pending.is_empty() || (!inflight_full && !collision) => match o { Ok(request) => { - self.state.handle_outgoing_packet(request)?; + if let Some(outgoing) = self.state.handle_outgoing_packet(request)? { + network.write(outgoing).await?; + } network.flush().await?; Ok(self.state.events.pop_front().unwrap()) }