Skip to content

Commit

Permalink
Further fix for large packets not being sent in a timely fashion.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Jan 6, 2021
1 parent c604cf8 commit fabdfcc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions apps/db_dump/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq)
return mosq_cs_new;
}

int mux__add_out(struct mosquitto *mosq)
{
return 0;
}

int mux__remove_out(struct mosquitto *mosq)
{
return 0;
Expand Down
2 changes: 0 additions & 2 deletions lib/mosquitto_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ struct mosquitto {
struct session_expiry_list *expiry_list_item;
uint16_t remote_port;
#endif
#ifdef WITH_EPOLL
uint32_t events;
#endif
};

#define STREMPTY(str) (str[0] == '\0')
Expand Down
5 changes: 4 additions & 1 deletion lib/packet_mosq.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ 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 @@ -216,6 +215,10 @@ int packet__write(struct mosquitto *mosq)
if(!mosq) return MOSQ_ERR_INVAL;
if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN;

#ifdef WITH_BROKER
mux__add_out(mosq);
#endif

pthread_mutex_lock(&mosq->current_out_packet_mutex);
pthread_mutex_lock(&mosq->out_packet_mutex);
if(mosq->out_packet && !mosq->current_out_packet){
Expand Down

0 comments on commit fabdfcc

Please sign in to comment.