[Libwebsockets] libwebsockets 1.0 issue

"Andy Green (林安廸)" andy at warmcat.com
Sat Mar 23 03:09:06 CET 2013


On 19/03/13 08:29, the mail apparently from "Andy Green (林安廸)" included:
> On 19/03/13 07:15, the mail apparently from Jandhyala, Anu included:
>
> Hi -
>
>> I use the library for the server side of our application. We are on
>> version 1.0-chrome25-firefox17 compatible version.
>
> Thanks for the report.
>
>> The application relies on the library to parse out the frame and give
>> the payload. We have a data structure to hold data while it is being
>> processed:
>>
>>              protocols[0].name = "wms-web-protocol";
>>
>>              protocols[0].callback = &callback_wmswebsocket;
>>
>>              protocols[0].per_session_data_size = sizeof(struct
>> WebHandShake);
>>
>> Lately one of our client applications sends very large messages > 4k
>> sizes.  The library fails in a couple of different ways, but may be for
>> the same reason:
>>
>> 1.Incoming message size = 4344 bytes (chrome 25 browser, not sure why it
>> is not in 4k chunk)
>>
>> This fails with “Unhandled extended opcode 0x7 - ignoring frame”
>
> Hm this kind of problem is corrupted framing data somehow.
>
>> In this case, I ran the code in debug more; Parser reads and copies 4096
>> bytes and look at OP CODE 7 and fails.
>>
>> 2.Incoming message = 4096 bytes ; message 2 = 1564 bytes
>>
>> In this case, the first 4k is parsed nicely, but for the second chunk:
>> library spits out a series of opcode failures even when n= 4/5/6:
>>
>> Unhandled extended opcode 0xd - ignoring frame
>>
>> Unhandled extended opcode 0xc - ignoring frame
>>
>> Unhandled extended opcode 0xb - ignoring frame
>>
>> Unhandled extended opcode 0x4 - ignoring frame
>>
>> Unhandled extended opcode 0x6 - ignoring frame
>>
>> Unhandled extended opcode 0xd - ignoring frame
>>
>> Unhandled extended opcode 0xe - ignoring frame
>>
>> Unhandled extended opcode 0xe - ignoring frame
>>
>> Unhandled extended opcode 0x5 - ignoring frame
>>
>> Unhandled extended opcode 0x3 - ignoring frame
>>
>> Unhandled extended opcode 0x6 - ignoring frame
>>
>> Unhandled extended opcode 0x6 - ignoring frame
>>
>> So I increased the receive buffer size to 12K. (yikes! But these are
>
> That is good news ^^
>
>> large XML messages). Now my problem is gone. But I thought I will run
>> this by the warmcat team.. is there a way to increase receive buffer
>> size? Or is there a way to process >4k chunks differently. Frankly, I
>> wish the browser engines let you configure this setting so both ends are
>> talking same sizes..
>
> I think this issue may boil down to a problem with deflate-frame (I
> assume deflate-frame was negotiated).
>
> Unfortunately my workload at my real job is beyond 100% for the near
> future, I will have to batch up looking at these issues and the other
> pending ones until the weekend.

The weekend arrived... please try this again using current HEAD rather 
than v1.0.  I didn't notice it was happening on a old version.

There were a lot of patches inbetween 1.0 and today that could affect 
this.  If you still have a problem, it's helpful if there's some kind of 
reproducer I can run.

-Andy




More information about the Libwebsockets mailing list