Skip to content

Commit c4ce2f7

Browse files
author
Devdutt Shenoi
committed
fix: direct resolve for QoS 0
1 parent 176fe5c commit c4ce2f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rumqttc/src/state.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ impl MqttState {
365365

366366
let event = Event::Outgoing(Outgoing::Publish(publish.pkid));
367367
self.events.push_back(event);
368-
self.ack_waiter[publish.pkid as usize] = tx;
368+
match (publish.qos, tx) {
369+
(QoS::AtMostOnce, Some(tx)) => tx.resolve(),
370+
(_, tx) => self.ack_waiter[publish.pkid as usize] = tx,
371+
}
369372

370373
Ok(Some(Packet::Publish(publish)))
371374
}

0 commit comments

Comments
 (0)