Skip to content

Commit

Permalink
Fix bridge tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Dec 19, 2018
1 parent fcf4cd0 commit ec11788
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/subs.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ and the Eclipse Distribution License is available at

#include "mosquitto_broker_internal.h"
#include "memory_mosq.h"
#include "mqtt_protocol.h"
#include "util_mosq.h"

struct sub__token {
Expand Down Expand Up @@ -97,7 +98,7 @@ static int subs__process(struct mosquitto_db *db, struct mosquitto__subhier *hie
}
}
while(source_id && leaf){
if(!leaf->context->id || leaf->no_local){
if(!leaf->context->id || (leaf->no_local && !strcmp(leaf->context->id, source_id))){
leaf = leaf->next;
continue;
}
Expand Down Expand Up @@ -274,8 +275,8 @@ static int sub__add_recurse(struct mosquitto_db *db, struct mosquitto *context,
leaf->next = NULL;
leaf->context = context;
leaf->qos = qos;
leaf->no_local = ((options & 0x04) != 0);
leaf->retain_as_published = ((options & 0x08) != 0);
leaf->no_local = ((options & MQTT_SUB_OPT_NO_LOCAL) != 0);
leaf->retain_as_published = ((options & MQTT_SUB_OPT_RETAIN_AS_PUBLISHED) != 0);
for(i=0; i<context->sub_count; i++){
if(!context->subs[i]){
context->subs[i] = subhier;
Expand Down

0 comments on commit ec11788

Please sign in to comment.