Skip to content

Commit 0f05995

Browse files
committed
* fix logic but in this pr
* log errors properlly in event loop
1 parent e7b52a4 commit 0f05995

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

rumqttc/src/eventloop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ impl EventLoop {
161161
match self.select().await {
162162
Ok(v) => Ok(v),
163163
Err(e) => {
164+
log::error!("connection error : {e}");
164165
self.clean();
165166
Err(e)
166167
}

rumqttc/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ impl MqttState {
323323
/// Adds next packet identifier to QoS 1 and 2 publish packets and returns
324324
/// it buy wrapping publish in packet
325325
fn outgoing_publish(&mut self, mut publish: Publish) -> Result<Option<Packet>, StateError> {
326-
if publish.qos != QoS::AtMostOnce || publish.pkid > self.max_inflight {
326+
if publish.qos != QoS::AtMostOnce && publish.pkid <= self.max_inflight {
327327
if publish.pkid == 0 {
328328
publish.pkid = self.next_pkid();
329329
}

0 commit comments

Comments
 (0)