Fix connections retrying very rapidly in some situations.

Thanks to Abilio Marques.
pull/2166/head
Roger A. Light 5 years ago
parent 891be8c2fe
commit f8838243fb

@ -28,6 +28,7 @@ Broker:
Client library:
- Fix encrypted connections incorrectly connecting when the CA file passed to
`mosquitto_tls_set()` is empty or invalid. Closes #2130.
- Fix connections retrying very rapidly in some situations.
Build:
- Fix cmake epoll detection.

@ -203,6 +203,13 @@ static int interruptible_sleep(struct mosquitto *mosq, time_t reconnect_delay)
char pairbuf;
int maxfd = 0;
#ifndef WIN32
if(read(mosq->sockpairR, &pairbuf, 1) == 0){
}
#else
recv(mosq->sockpairR, &pairbuf, 1, 0);
#endif
local_timeout.tv_sec = reconnect_delay;
#ifdef HAVE_PSELECT
local_timeout.tv_nsec = 0;

Loading…
Cancel
Save