Don't confuse expiring and duplicate clients.

This commit is contained in:
Roger A. Light
2018-08-15 17:27:59 +01:00
parent f815d5fd1e
commit a199cac69e
3 changed files with 3 additions and 4 deletions
+1
View File
@@ -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 {
+1 -1
View File
@@ -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
View File
@@ -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);