diff --git a/lib/output.c b/lib/output.c index 3dbe8bb1..656cfafb 100644 --- a/lib/output.c +++ b/lib/output.c @@ -127,7 +127,7 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) lwsl_warn("** error invalid sock but expected to send\n"); /* limit sending */ - n = wsi->protocol->rx_buffer_size; + n = wsi->protocol->rx_buffer_size + LWS_PRE + 4; if (!n) n = LWS_MAX_SOCKET_IO_BUF; if (n > len)