Fixed issue '30 to avoid publish of QoS0 to not Active clean session subscriptions

This commit is contained in:
selva.andre
2014-02-08 20:01:59 +01:00
parent 56a178c786
commit 4ff6b2aeae
4 changed files with 37 additions and 8 deletions
@@ -261,9 +261,6 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
//QoS 0
sendPublish(sub.getClientId(), topic, qos, message, false);
} else {
//TODO BUG if the sub is not active the code and the cleanSession is true
//then publish to the subscriber (that is not active)
//QoS 1 or 2
//if the target subscription is not clean session and is not connected => store it
if (!sub.isCleanSession() && !sub.isActive()) {
@@ -278,7 +275,9 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
m_storageService.addInFlight(newPublishEvt, publishKey);
}
//publish
sendPublish(sub.getClientId(), topic, qos, message, false);
if (sub.isActive()) {
sendPublish(sub.getClientId(), topic, qos, message, false);
}
}
}
}