Skip to content

Commit 1670b04

Browse files
sp193Liu Woon Yung
authored andcommitted
Fixed token not getting saved into tokenStore for QoS0 publishes, which fixes publish() hanging when the connection fails.
Signed-off-by: Liu Woon Yung <pirorin187@gmail.com>
1 parent 17fd7be commit 1670b04

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/ClientState.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ public void send(MqttWireMessage message, MqttToken token) throws MqttException
542542
persistence.put(getSendPersistenceKey(message), (MqttPublish) message);
543543
tokenStore.saveToken(token, message);
544544
break;
545+
case 0:
546+
tokenStore.saveToken(token, message);
547+
break;
545548
}
546549
pendingMessages.addElement(message);
547550
queueLock.notifyAll();

0 commit comments

Comments
 (0)