Fix for MQTT-3.8.4-3.
This commit is contained in:
parent
85af9bdd9a
commit
e4ddc31295
13
src/subs.c
13
src/subs.c
@ -229,6 +229,19 @@ static int _sub_add(struct mosquitto_db *db, struct mosquitto *context, int qos,
|
||||
leaf = subhier->subs;
|
||||
last_leaf = NULL;
|
||||
while(leaf){
|
||||
if(leaf->context && leaf->context->id && !strcmp(leaf->context->id, context->id)){
|
||||
/* Client making a second subscription to same topic. Only
|
||||
* need to update QoS. Return -1 to indicate this to the
|
||||
* calling function. */
|
||||
leaf->qos = qos;
|
||||
if(context->protocol == mosq_p_mqtt31){
|
||||
return -1;
|
||||
}else{
|
||||
/* mqttv311 requires retained messages are resent on
|
||||
* resubscribe. */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
last_leaf = leaf;
|
||||
leaf = leaf->next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user