diff --git a/src/read_handle_server.c b/src/read_handle_server.c index 3cc68566..f5889adc 100644 --- a/src/read_handle_server.c +++ b/src/read_handle_server.c @@ -481,6 +481,7 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context) found_context->ws_context = context->ws_context; found_context->sock = WEBSOCKET_CLIENT; context->wsi = NULL; + context->ws_context = NULL; context->sock = INVALID_SOCKET; /* This is a hack to allow us to update the wsi->user_space diff --git a/src/subs.c b/src/subs.c index c042e299..4b778e95 100644 --- a/src/subs.c +++ b/src/subs.c @@ -97,7 +97,7 @@ static int _subs_process(struct mosquitto_db *db, struct _mosquitto_subhier *hie } } while(source_id && leaf){ - if(leaf->context->is_bridge && !strcmp(leaf->context->id, source_id)){ + if(!leaf->context->id || (leaf->context->is_bridge && !strcmp(leaf->context->id, source_id))){ leaf = leaf->next; continue; }