Don't confuse expiring and duplicate clients.

pull/1600/head
Roger A. Light 7 years ago
parent e91cb7a79d
commit 2f47f31f29

@ -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);
}

@ -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);

Loading…
Cancel
Save