Skip to content

Commit

Permalink
Serious bug in MQTTKit.m
Browse files Browse the repository at this point in the history
Serious bug here, which tied up my server for a week.  initWithClientId takes BOOL cleanSession as parameter, which is almost always set to YES.  However, when it sends it to mosquito_new(), it sends the class property, self.cleanSession, which is not initialized, thus is always NO.  Using this code sets durable clients in the file, and causes the transmit queue to clog up waiting for those clients to sign in again and get their messages.
  • Loading branch information
scapegoat4U committed Sep 12, 2014
1 parent 2034771 commit b9d4050
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions MQTTKit/MQTTKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ - (MQTTClient*) initWithClientId: (NSString *)clientId
self.subscriptionHandlers = [[NSMutableDictionary alloc] init];
self.unsubscriptionHandlers = [[NSMutableDictionary alloc] init];
self.publishHandlers = [[NSMutableDictionary alloc] init];
self.cleanSession = cleanSession;

const char* cstrClientId = [self.clientID cStringUsingEncoding:NSUTF8StringEncoding];

Expand Down

0 comments on commit b9d4050

Please sign in to comment.