Fixed a bug in store remove subscription that doesn't check the clientID but just the topic match

This commit is contained in:
andrea
2013-12-14 14:03:49 +01:00
parent 0ac76e3452
commit 43ce8d6372
3 changed files with 24 additions and 2 deletions
@@ -124,10 +124,10 @@ public class SubscriptionsStore {
public void removeSubscription(String topic, String clientID) {
TreeNode matchNode = findMatchingNode(topic);
//search fr the subscription to remove
//search for the subscription to remove
Subscription toBeRemoved = null;
for (Subscription sub : matchNode.subscriptions()) {
if (sub.topic.equals(topic)) {
if (sub.topic.equals(topic) && sub.getClientId().equals(clientID)) {
toBeRemoved = sub;
break;
}