[Libwebsockets] Problem sending more than 3263 bytes on ws

Andy Green andy at warmcat.com
Sat Jun 30 04:22:08 CEST 2018

On 06/29/2018 08:24 PM, Andy Green wrote:
> On 06/28/2018 08:53 PM, pierre30 at gmail.com wrote:

>> The problem seems to be the same with my server and your example 
>> server...
>> If I reduce the size of the message REPEAT_STRING_LEN = 500, no problem.
>> Here also if I disable the permessage-deflate extension I get the 
>> 133700 bytes in the textarea and the console. The problem seems to be 
>> linked to permessage-deflate. Maybe Edge is not using permessage-deflate?
>> Is it possible that permessage-deflate sends a wrong packet size 
>> bigger than the actual size?
>> I tried version libwebsockets 3.0.0 v2.0.0-985-gc708bda0.
>> Could you reproduce it or does it works well on your computer?
> Looks like something up somewhere... I'll look at it closer tomorrow 
> (~+12h).

It's a problem introduced during the big "role" refactor before v3.0 was 
released.  This fixes it here:

diff --git a/lib/roles/ws/ops-ws.c b/lib/roles/ws/ops-ws.c
index d6e690ee..8a25f531 100644
--- a/lib/roles/ws/ops-ws.c
+++ b/lib/roles/ws/ops-ws.c
@@ -1280,7 +1280,7 @@ int rops_handle_POLLOUT_ws(struct lws *wsi)
          *             payload ordering, but since they are always complete
          *             fragments control packets can interleave OK.
-       if (lwsi_role_client(wsi) && wsi->ws->tx_draining_ext) {
+       if (wsi->ws->tx_draining_ext) {
                 lwsl_ext("SERVICING TX EXT DRAINING\n");
                 if (lws_write(wsi, NULL, 0, LWS_WRITE_CONTINUATION) < 0)
                         return LWS_HP_RET_BAIL_DIE;

I pushed that and some other related cleanup like reduce the loglevel of 
the NOTICE stuff to EXTENSION on v3.0-stable and master.

Autobahn remains happy.  So please give it a try.


More information about the Libwebsockets mailing list