diff --git a/ChangeLog.txt b/ChangeLog.txt index 8594531e..bddabfea 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -18,6 +18,7 @@ Client library: - Fix possibility of select() being called with a socket that is >FD_SETSIZE. This is a fix for #464632 that will be followed up by removing the select() call in a future version. +- Fix calls to mosquitto_connect*_async() not completing. 1.4.1 - 20150403 diff --git a/client/client_shared.c b/client/client_shared.c index df8ad1d3..00f5c6c0 100644 --- a/client/client_shared.c +++ b/client/client_shared.c @@ -745,7 +745,7 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg) #else rc = mosquitto_connect_bind(mosq, cfg->host, cfg->port, cfg->keepalive, cfg->bind_address); #endif - if(rc){ + if(rc>0){ if(!cfg->quiet){ if(rc == MOSQ_ERR_ERRNO){ #ifndef WIN32 diff --git a/lib/mosquitto.c b/lib/mosquitto.c index 71633d81..5b5a9533 100644 --- a/lib/mosquitto.c +++ b/lib/mosquitto.c @@ -517,7 +517,7 @@ static int _mosquitto_reconnect(struct mosquitto *mosq, bool blocking) { rc = _mosquitto_socket_connect(mosq, mosq->host, mosq->port, mosq->bind_address, blocking); } - if(rc){ + if(rc>0){ return rc; }