fix incorrect return code when connecting in non-blocking mode

Signed-off-by: krismattheus <kris.mattheus@visionbms.com>
pull/1203/head
krismattheus 8 years ago committed by Roger A. Light
parent 571c643b3d
commit 479d8e5f1a

@ -757,7 +757,7 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host)
int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking)
{
mosq_sock_t sock = INVALID_SOCKET;
int rc;
int rc, rc2;
if(!mosq || !host || !port) return MOSQ_ERR_INVAL;
@ -770,8 +770,8 @@ int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port,
if(!mosq->socks5_host)
#endif
{
rc = net__socket_connect_step3(mosq, host);
if(rc) return rc;
rc2 = net__socket_connect_step3(mosq, host);
if(rc2) return rc2;
}
return MOSQ_ERR_SUCCESS;

Loading…
Cancel
Save