diff --git a/ChangeLog.txt b/ChangeLog.txt index 7d6a92cf..fe12bb1d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +2.1.3 - 2026-02-xx +================== + +Broker: +- Fix MOSQ_EVT_DISCONNECT being called before MOSQ_EVT_ACL_CHECK for the will + of that client. Closes #3487. + + 2.1.2 - 2026-02-09 ================== diff --git a/src/context.c b/src/context.c index ca4784d9..6b397d47 100644 --- a/src/context.c +++ b/src/context.c @@ -269,13 +269,14 @@ void context__disconnect(struct mosquitto *context, int reason) } } + context__send_will(context); + if(context->session_expiry_interval == MQTT_SESSION_EXPIRY_IMMEDIATE){ plugin__handle_disconnect(context, reason); }else{ plugin__handle_client_offline(context, reason); } - context__send_will(context); net__socket_close(context); #ifdef WITH_BRIDGE if(context->bridge == NULL)