From 982758a76ec80fe3531ef34a03e924f69509410b Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 4 Sep 2019 17:51:16 +0100 Subject: [PATCH] Fix bridges potentially not connecting on Windows. Closes #478. --- ChangeLog.txt | 1 + lib/packet_mosq.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b7340480..e794a95a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,6 +3,7 @@ Broker: protocol error. Closes #1367. - Fix support for libwebsockets 3.x. - Fix slow websockets performance when sending large messages. Closes #1390. +- Fix bridges potentially not connecting on Windows. Closes #478. Documentation: - Improve details on global/per listener options in the mosquitto.conf man page. diff --git a/lib/packet_mosq.c b/lib/packet_mosq.c index 22df79e5..dc545435 100644 --- a/lib/packet_mosq.c +++ b/lib/packet_mosq.c @@ -239,7 +239,11 @@ int packet__write(struct mosquitto *mosq) #ifdef WIN32 errno = WSAGetLastError(); #endif - if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK){ + if(errno == EAGAIN || errno == COMPAT_EWOULDBLOCK +#ifdef WIN32 + || errno == WSAENOTCONN +#endif + ){ pthread_mutex_unlock(&mosq->current_out_packet_mutex); return MOSQ_ERR_SUCCESS; }else{