Fix large packets not being completely published to slow clients.

Also fix bridge connection not relinquishing POLLOUT after messages are
sent.

Closes #1977. Thanks to marchaesen.
Closes #1979. Thanks to GorazdKikelj.
This commit is contained in:
Roger A. Light 2020-12-27 23:03:38 +00:00
parent 9d3732a62d
commit b2da540c64
3 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,10 @@
Broker: Broker:
- Fix `auth_method` not being provided to the extended auth plugin event. - Fix `auth_method` not being provided to the extended auth plugin event.
Closes #1975. Closes #1975.
- Fix large packets not being completely published to slow clients.
Closes #1977.
- Fix bridge connection not relinquishing POLLOUT after messages are sent.
Closes #1979.
2.0.4 - 2020-12-22 2.0.4 - 2020-12-22

View File

@ -38,6 +38,11 @@ enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq)
return mosq_cs_new; return mosq_cs_new;
} }
int mux__remove_out(struct mosquitto *mosq)
{
return 0;
}
ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count) ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
{ {
return 0; return 0;

View File

@ -164,6 +164,7 @@ int packet__queue(struct mosquitto *mosq, struct mosquitto__packet *packet)
lws_callback_on_writable(mosq->wsi); lws_callback_on_writable(mosq->wsi);
return MOSQ_ERR_SUCCESS; return MOSQ_ERR_SUCCESS;
}else{ }else{
mux__add_out(mosq);
return packet__write(mosq); return packet__write(mosq);
} }
# else # else
@ -314,6 +315,9 @@ int packet__write(struct mosquitto *mosq)
#ifdef WITH_BROKER #ifdef WITH_BROKER
mosq->next_msg_out = db.now_s + mosq->keepalive; mosq->next_msg_out = db.now_s + mosq->keepalive;
if(mosq->current_out_packet == NULL){
mux__remove_out(mosq);
}
#else #else
pthread_mutex_lock(&mosq->msgtime_mutex); pthread_mutex_lock(&mosq->msgtime_mutex);
mosq->next_msg_out = mosquitto_time() + mosq->keepalive; mosq->next_msg_out = mosquitto_time() + mosq->keepalive;