mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-22 16:15:05 +08:00
Don't confuse expiring and duplicate clients.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -608,9 +608,7 @@ void do_disconnect(struct mosquitto_db *db, struct mosquitto *context)
|
||||
}else{
|
||||
id = "<unknown>";
|
||||
}
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user