Further fix for large packets not being sent in a timely fashion.

pull/1698/head
Roger A. Light 5 years ago
parent c604cf8fd0
commit fabdfcc060

@ -38,6 +38,11 @@ enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq)
return mosq_cs_new; return mosq_cs_new;
} }
int mux__add_out(struct mosquitto *mosq)
{
return 0;
}
int mux__remove_out(struct mosquitto *mosq) int mux__remove_out(struct mosquitto *mosq)
{ {
return 0; return 0;

@ -350,9 +350,7 @@ struct mosquitto {
struct session_expiry_list *expiry_list_item; struct session_expiry_list *expiry_list_item;
uint16_t remote_port; uint16_t remote_port;
#endif #endif
#ifdef WITH_EPOLL
uint32_t events; uint32_t events;
#endif
}; };
#define STREMPTY(str) (str[0] == '\0') #define STREMPTY(str) (str[0] == '\0')

@ -164,7 +164,6 @@ 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
@ -216,6 +215,10 @@ int packet__write(struct mosquitto *mosq)
if(!mosq) return MOSQ_ERR_INVAL; if(!mosq) return MOSQ_ERR_INVAL;
if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN; 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->current_out_packet_mutex);
pthread_mutex_lock(&mosq->out_packet_mutex); pthread_mutex_lock(&mosq->out_packet_mutex);
if(mosq->out_packet && !mosq->current_out_packet){ if(mosq->out_packet && !mosq->current_out_packet){

Loading…
Cancel
Save