Fix mosquitto_want_write for TLS sock connecting

Copied logic from mosquitto_loop which was already patched by
39ffd6fa.

Bugs: #648
This commit is contained in:
Pierre Fersing 2018-01-05 15:39:11 +01:00
parent c86b38cab6
commit 254f30cdb1

View File

@ -1202,15 +1202,20 @@ int mosquitto_loop_write(struct mosquitto *mosq, int max_packets)
bool mosquitto_want_write(struct mosquitto *mosq)
{
bool result = false;
if(mosq->out_packet || mosq->current_out_packet){
return true;
#ifdef WITH_TLS
}else if(mosq->ssl && mosq->want_write){
return true;
#endif
}else{
return false;
result = true;
}
#ifdef WITH_TLS
if(mosq->ssl){
if (mosq->want_write) {
result = true;
}else if(mosq->want_connect){
result = false;
}
}
#endif
return result;
}
int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *value)