Skip to content

Commit

Permalink
Fix large packets not being completely published to slow clients.
Browse files Browse the repository at this point in the history
Also fix bridge connection not relinquishing POLLOUT after messages are
sent.

Closes #1977. Thanks to marchaesen.
Closes #1979. Thanks to GorazdKikelj.
  • Loading branch information
ralight committed Dec 27, 2020
1 parent 9d3732a commit b2da540
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.txt
@@ -1,6 +1,10 @@
Broker:
- Fix `auth_method` not being provided to the extended auth plugin event.
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
Expand Down
5 changes: 5 additions & 0 deletions apps/db_dump/stubs.c
Expand Up @@ -38,6 +38,11 @@ enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq)
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)
{
return 0;
Expand Down
4 changes: 4 additions & 0 deletions lib/packet_mosq.c
Expand Up @@ -164,6 +164,7 @@ int packet__queue(struct mosquitto *mosq, struct mosquitto__packet *packet)
lws_callback_on_writable(mosq->wsi);
return MOSQ_ERR_SUCCESS;
}else{
mux__add_out(mosq);
return packet__write(mosq);
}
# else
Expand Down Expand Up @@ -314,6 +315,9 @@ int packet__write(struct mosquitto *mosq)

#ifdef WITH_BROKER
mosq->next_msg_out = db.now_s + mosq->keepalive;
if(mosq->current_out_packet == NULL){
mux__remove_out(mosq);
}
#else
pthread_mutex_lock(&mosq->msgtime_mutex);
mosq->next_msg_out = mosquitto_time() + mosq->keepalive;
Expand Down

0 comments on commit b2da540

Please sign in to comment.