diff --git a/lib/mosquitto_internal.h b/lib/mosquitto_internal.h index 960c1f41..de82ec3d 100644 --- a/lib/mosquitto_internal.h +++ b/lib/mosquitto_internal.h @@ -108,6 +108,7 @@ enum mosquitto_client_state { mosq_cs_socks5_send_userpass = 14, mosq_cs_expiring = 15, mosq_cs_connecting = 16, + mosq_cs_duplicate = 17, /* client that has been taken over by another with the same id */ }; enum mosquitto__protocol { diff --git a/src/handle_connect.c b/src/handle_connect.c index 9e24f421..b12247e9 100644 --- a/src/handle_connect.c +++ b/src/handle_connect.c @@ -598,7 +598,7 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context) } found_context->clean_session = true; - found_context->state = mosq_cs_expiring; + found_context->state = mosq_cs_duplicate; do_disconnect(db, found_context); } diff --git a/src/loop.c b/src/loop.c index 78c5da65..04481434 100644 --- a/src/loop.c +++ b/src/loop.c @@ -608,9 +608,7 @@ void do_disconnect(struct mosquitto_db *db, struct mosquitto *context) }else{ id = ""; } - 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){ + 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);