Clear want_write flag after responding to it.

Prevents busy loop after e.g. writing a large message when using TLS.

Thanks to Dave Sellars.
pull/211/merge
Roger A. Light 11 years ago
parent d6bb6634d2
commit ac5dbd428f

@ -841,6 +841,7 @@ int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets)
#ifdef WITH_TLS
}else if(mosq->ssl && mosq->want_write){
FD_SET(mosq->sock, &writefds);
mosq->want_write = false;
#endif
}
pthread_mutex_unlock(&mosq->out_packet_mutex);

Loading…
Cancel
Save