Fixed bug #143 avoid publication try to disconnected clients

This commit is contained in:
andsel
2016-01-25 22:21:38 +01:00
parent 43f7223a15
commit dfa75e145f
2 changed files with 18 additions and 0 deletions
@@ -214,6 +214,10 @@ public class SubscriptionsStore {
for (ClientTopicCouple matchingCouple : matchingSubs) {
Subscription existingSub = subsForClient.get(matchingCouple.clientID);
Subscription sub = m_sessionsStore.getSubscription(matchingCouple);
if (sub == null) {
//if the m_sessionStore hasn't the sub because the client disconnected
continue;
}
//update the selected subscriptions if not present or if has a greater qos
if (existingSub == null || existingSub.getRequestedQos().byteValue() < sub.getRequestedQos().byteValue()) {
subsForClient.put(matchingCouple.clientID, sub);