Fix issue when SSL_connect() returns SSL_ERROR_WANT_READ. A call to SSL_write here will later transmit a new client hello and make ssl connection fail.

Signed-off-by: JonoJensen <jono.jensen@yahoo.se>
This commit is contained in:
JonoJensen 2017-11-03 22:08:02 +01:00 committed by Roger Light
parent c4f8bee34c
commit 7d8d04bc39

View File

@ -871,7 +871,11 @@ int _mosquitto_packet_write(struct mosquitto *mosq)
} }
pthread_mutex_unlock(&mosq->out_packet_mutex); pthread_mutex_unlock(&mosq->out_packet_mutex);
#if defined(WITH_TLS) && !defined(WITH_BROKER)
if((mosq->state == mosq_cs_connect_pending)||mosq->want_connect){
#else
if(mosq->state == mosq_cs_connect_pending){ if(mosq->state == mosq_cs_connect_pending){
#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;
} }