Improve logging in obscure cases when a client disconnects.

Closes #2017. Thanks to Craig Leres.
pull/2027/head
Roger A. Light 5 years ago
parent 9c4b9a0311
commit e2ebddfc54

@ -6,6 +6,7 @@ Broker:
- Fix websockets listeners with TLS not responding. Closes #2020.
- Add notes that libsystemd-dev or similar is needed if building with systemd
support. Closes #2019.
- Improve logging in obscure cases when a client disconnects. Closes #2017.
Apps:
- Allow command line arguments to override config file options in

@ -353,8 +353,11 @@ void do_disconnect(struct mosquitto *context, int reason)
case MOSQ_ERR_ADMINISTRATIVE_ACTION:
log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s been disconnected by administrative action.", id);
break;
case MOSQ_ERR_ERRNO:
log__printf(NULL, MOSQ_LOG_NOTICE, "Client %s disconnected: %s.", id, strerror(errno));
break;
default:
log__printf(NULL, MOSQ_LOG_NOTICE, "Bad socket read/write on client %s, disconnecting.", id);
log__printf(NULL, MOSQ_LOG_NOTICE, "Bad socket read/write on client %s: %s.", id, mosquitto_strerror(reason));
break;
}
}else{

Loading…
Cancel
Save