Fix subscriptions sometimes being deleted.
Fix subscriptions being deleted when clients subscribed to a topic beginning with a $ but that is not $SYS. Thanks to David Woodward.
This commit is contained in:
parent
ab15557931
commit
e5cc63a89b
@ -5,8 +5,8 @@ Broker:
|
||||
- Ensure that bridges verify certificates by default when using TLS.
|
||||
- Fix possible crash when using pattern ACLs that do not include a %u and
|
||||
clients that connect without a username.
|
||||
|
||||
|
||||
- Fix subscriptions being deleted when clients subscribed to a topic beginning
|
||||
with a $ but that is not $SYS.
|
||||
|
||||
Client library:
|
||||
- Fix topic matching edge case.
|
||||
|
@ -377,7 +377,6 @@ int mqtt3_sub_add(struct mosquitto_db *db, struct mosquitto *context, const char
|
||||
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory.");
|
||||
return MOSQ_ERR_NOMEM;
|
||||
}
|
||||
child->next = NULL;
|
||||
child->topic = _mosquitto_strdup(tokens->topic);
|
||||
if(!child->topic){
|
||||
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory.");
|
||||
@ -386,6 +385,11 @@ int mqtt3_sub_add(struct mosquitto_db *db, struct mosquitto *context, const char
|
||||
child->subs = NULL;
|
||||
child->children = NULL;
|
||||
child->retained = NULL;
|
||||
if(db->subs.children){
|
||||
child->next = db->subs.children;
|
||||
}else{
|
||||
child->next = NULL;
|
||||
}
|
||||
db->subs.children = child;
|
||||
|
||||
rc = _sub_add(db, context, qos, child, tokens);
|
||||
|
Loading…
Reference in New Issue
Block a user