Skip to content

Commit

Permalink
Don't disconnect clients that are already disconnected.
Browse files Browse the repository at this point in the history
This prevents the session expiry being extended on SIGHUP.

Closes eclipse#1521. Thanks to Christoph Krey.
  • Loading branch information
ralight authored and FranciscoKnebel committed Jul 30, 2020
1 parent 5cd4635 commit d4b766d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.txt
Expand Up @@ -5,6 +5,11 @@ Broker:
correctly. Creating a new user with `-b` worked without problem.
Closes #1664.
- Fix memory leak when connecting clients rejected.
- Don't disconnect clients that are already disconnected. This prevents the
session expiry being extended on SIGHUP. Closes #1521.

1.6.8 - 20191128
================

Client library:
- Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error.
Expand Down
4 changes: 4 additions & 0 deletions src/context.c
Expand Up @@ -226,6 +226,10 @@ void context__send_will(struct mosquitto_db *db, struct mosquitto *ctxt)

void context__disconnect(struct mosquitto_db *db, struct mosquitto *context)
{
if(mosquitto__get_state(context) == mosq_cs_disconnected){
return;
}

net__socket_close(db, context);

context__send_will(db, context);
Expand Down

0 comments on commit d4b766d

Please sign in to comment.