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.
This commit is contained in:
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…
Reference in New Issue
Block a user