From 2aceb704b55dd79d5f48350c6317690eddd8d243 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 27 Mar 2015 01:24:16 +0000 Subject: [PATCH] [463000] Fix reconnect bug on Windows. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463000 --- ChangeLog.txt | 1 + lib/mosquitto.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index bbbef2cb..17281c04 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -6,6 +6,7 @@ Broker: Client library: - Inflight limits should only apply to outgoing messages. Closes #461620. +- Fix reconnect bug on Windows. Closes #463000. 1.4 - 20150218 diff --git a/lib/mosquitto.c b/lib/mosquitto.c index 66fd3600..b5cf5dd1 100644 --- a/lib/mosquitto.c +++ b/lib/mosquitto.c @@ -931,7 +931,7 @@ int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets) } } } - if(mosq->sockpairR >= 0 && FD_ISSET(mosq->sockpairR, &readfds)){ + if(mosq->sockpairR != INVALID_SOCKET && FD_ISSET(mosq->sockpairR, &readfds)){ #ifndef WIN32 if(read(mosq->sockpairR, &pairbuf, 1) == 0){ }