Free outgoing client messages even for non-bridges.
This commit is contained in:
parent
ee7d1981ff
commit
e755827f4f
@ -103,6 +103,10 @@ void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool d
|
||||
|
||||
if(!context) return;
|
||||
|
||||
if(do_free){
|
||||
context->clean_start = true;
|
||||
}
|
||||
|
||||
#ifdef WITH_BRIDGE
|
||||
if(context->bridge){
|
||||
bridge__cleanup(db, context);
|
||||
@ -121,7 +125,7 @@ void context__cleanup(struct mosquitto_db *db, struct mosquitto *context, bool d
|
||||
context->password = NULL;
|
||||
|
||||
net__socket_close(db, context);
|
||||
if(do_free || context->clean_start){
|
||||
if(do_free){
|
||||
sub__clean_session(db, context);
|
||||
}
|
||||
db__messages_delete(db, context);
|
||||
|
@ -124,7 +124,7 @@ int db__open(struct mosquitto__config *config, struct mosquitto_db *db)
|
||||
db->bridge_count = 0;
|
||||
#endif
|
||||
|
||||
// Initialize the hashtable
|
||||
/* Initialize the hashtable */
|
||||
db->clientid_index_hash = NULL;
|
||||
|
||||
db->subs = NULL;
|
||||
@ -573,7 +573,9 @@ int db__messages_delete(struct mosquitto_db *db, struct mosquitto *context)
|
||||
context->msgs_in.msg_count12 = 0;
|
||||
}
|
||||
|
||||
if(context->bridge && context->bridge->clean_start_local){
|
||||
if((context->bridge && context->bridge->clean_start_local)
|
||||
|| (context->bridge == NULL && context->clean_start)){
|
||||
|
||||
db__messages_delete_list(db, &context->msgs_out.inflight);
|
||||
db__messages_delete_list(db, &context->msgs_out.queued);
|
||||
context->msgs_out.msg_bytes = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user