Return success on libwebsocket_write==0.
This commit is contained in:
parent
4bb7a45b71
commit
9ea161f90e
@ -74,7 +74,7 @@ int mosquitto_main_loop(struct mosquitto_db *db, int *listensock, int listensock
|
||||
int rc;
|
||||
#endif
|
||||
#ifdef WITH_WEBSOCKETS
|
||||
struct libwebsocket_context *ws_context;
|
||||
struct libwebsocket_context *ws_context = NULL;
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
|
@ -151,6 +151,9 @@ static int callback_mqtt(struct libwebsocket_context *context,
|
||||
packet->pos += LWS_SEND_BUFFER_PRE_PADDING;
|
||||
}
|
||||
count = libwebsocket_write(wsi, &packet->payload[packet->pos], packet->to_process, LWS_WRITE_BINARY);
|
||||
if(count < 0){
|
||||
return 0;
|
||||
}
|
||||
packet->to_process -= count;
|
||||
packet->pos += count;
|
||||
if(packet->to_process > 0){
|
||||
|
Loading…
Reference in New Issue
Block a user