Fix connections retrying very rapidly in some situations.

Thanks to Abilio Marques.
release/1.6
Roger A. Light 5 years ago
parent 84f4679c4d
commit 8442926841

@ -18,6 +18,7 @@ Broker:
Client library: Client library:
- Fix encrypted connections incorrectly connecting when the CA file passed to - Fix encrypted connections incorrectly connecting when the CA file passed to
`mosquitto_tls_set()` is empty or invalid. Closes #2130. `mosquitto_tls_set()` is empty or invalid. Closes #2130.
- Fix connections retrying very rapidly in some situations.
Clients: Clients:
- Fix possible loss of data in `mosquitto_pub -l` when sending multiple long - Fix possible loss of data in `mosquitto_pub -l` when sending multiple long

@ -209,6 +209,15 @@ static int interruptible_sleep(struct mosquitto *mosq, unsigned long reconnect_d
#else #else
local_timeout.tv_usec = 0; local_timeout.tv_usec = 0;
#endif #endif
#ifndef WIN32
if(read(mosq->sockpairR, &pairbuf, 1) == 0){
}
#else
recv(mosq->sockpairR, &pairbuf, 1, 0);
#endif
FD_ZERO(&readfds); FD_ZERO(&readfds);
maxfd = 0; maxfd = 0;
if(mosq->sockpairR != INVALID_SOCKET){ if(mosq->sockpairR != INVALID_SOCKET){

Loading…
Cancel
Save