[Libwebsockets] libwebsockets 1.0 issue

Jandhyala, Anu AJandhyala at wms.com
Tue Mar 19 00:15:03 CET 2013


Hello,
I use the library for the server side of our application. We are on version 1.0-chrome25-firefox17 compatible version.

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"

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 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..
Thanks,
Anu.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20130318/01a6e914/attachment.html>


More information about the Libwebsockets mailing list