Fix bridges potentially not connecting on Windows.

Closes #478.
This commit is contained in:
Roger A. Light 2019-09-04 17:51:16 +01:00
parent 76865707b2
commit 412379b03b
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ Broker:
protocol error. Closes #1367. protocol error. Closes #1367.
- Fix support for libwebsockets 3.x. - Fix support for libwebsockets 3.x.
- Fix slow websockets performance when sending large messages. Closes #1390. - Fix slow websockets performance when sending large messages. Closes #1390.
- Fix bridges potentially not connecting on Windows. Closes #478.
Documentation: Documentation:
- Improve details on global/per listener options in the mosquitto.conf man page. - Improve details on global/per listener options in the mosquitto.conf man page.

View File

@ -239,7 +239,11 @@ int packet__write(struct mosquitto *mosq)
#ifdef WIN32 #ifdef WIN32
errno = WSAGetLastError(); errno = WSAGetLastError();
#endif #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); pthread_mutex_unlock(&mosq->current_out_packet_mutex);
return MOSQ_ERR_SUCCESS; return MOSQ_ERR_SUCCESS;
}else{ }else{