Merge pull request #2145 from abiliojr/empty_sockpairR

Fully empty sockpairR on interruptible_sleep
pull/2166/head
Roger Light 5 years ago committed by GitHub
commit 0f9e5795a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -204,10 +204,9 @@ static int interruptible_sleep(struct mosquitto *mosq, time_t reconnect_delay)
int maxfd = 0; int maxfd = 0;
#ifndef WIN32 #ifndef WIN32
if(read(mosq->sockpairR, &pairbuf, 1) == 0){ while(read(mosq->sockpairR, &pairbuf, 1) > 0);
}
#else #else
recv(mosq->sockpairR, &pairbuf, 1, 0); while(recv(mosq->sockpairR, &pairbuf, 1, 0) > 0);
#endif #endif
local_timeout.tv_sec = reconnect_delay; local_timeout.tv_sec = reconnect_delay;

Loading…
Cancel
Save