Only remove from hash if a valid socket (i.e. if present)
This commit is contained in:
parent
3577dbf332
commit
482d604598
@ -425,7 +425,9 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context)
|
|||||||
found_context->address = NULL;
|
found_context->address = NULL;
|
||||||
}
|
}
|
||||||
found_context->disconnect_t = 0;
|
found_context->disconnect_t = 0;
|
||||||
HASH_DELETE(hh_sock, db->contexts_by_sock, context);
|
if(context->sock != INVALID_SOCKET){
|
||||||
|
HASH_DELETE(hh_sock, db->contexts_by_sock, context);
|
||||||
|
}
|
||||||
found_context->sock = context->sock;
|
found_context->sock = context->sock;
|
||||||
found_context->listener = context->listener;
|
found_context->listener = context->listener;
|
||||||
context->listener = NULL;
|
context->listener = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user