Unconditionally adding an event to the epoll causes 100% CPU usage. This happens when the connection to the server is established and the client has not sent any data yet.

Signed-off-by: Przemek Zygmunt <p.zygmunt@acsoftware.pl>
pull/2064/head
Przemek Zygmunt 5 years ago committed by Roger A. Light
parent 6e3738dcf0
commit 18bad1ff32

@ -216,7 +216,9 @@ int packet__write(struct mosquitto *mosq)
if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN;
#ifdef WITH_BROKER #ifdef WITH_BROKER
mux__add_out(mosq); if (mosq->current_out_packet) {
mux__add_out(mosq);
}
#endif #endif
pthread_mutex_lock(&mosq->current_out_packet_mutex); pthread_mutex_lock(&mosq->current_out_packet_mutex);

Loading…
Cancel
Save