Skip to content

Commit

Permalink
Fix for issue #874
Browse files Browse the repository at this point in the history
With special acknowledgement to sxsing (his github login) for his
help in development and testing of this fix.

NOTE: Pull-request is against master as the fixes branch has not
been updated with the v1.5 file src/handle_connect.c

Signed-off-by: Dave Miller <[email protected]>
  • Loading branch information
dmiller-tibco authored and ralight committed Aug 1, 2018
1 parent cd27104 commit 81a82f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/handle_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context)
}

found_context->clean_session = true;
found_context->state = mosq_cs_expiring;
do_disconnect(db, found_context);
}

Expand Down
4 changes: 3 additions & 1 deletion src/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,9 @@ void do_disconnect(struct mosquitto_db *db, struct mosquitto *context)
}else{
id = "<unknown>";
}
if(context->state != mosq_cs_disconnecting){
if (context->state == mosq_cs_expiring){
log__printf(NULL, MOSQ_LOG_NOTICE, "Expiring old client session %s, disconnecting.", id);
}else if(context->state != mosq_cs_disconnecting){
log__printf(NULL, MOSQ_LOG_NOTICE, "Socket error on client %s, disconnecting.", id);
}else{
log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s disconnected.", id);
Expand Down

0 comments on commit 81a82f6

Please sign in to comment.