[Libwebsockets] We met an issue when using libwebsocket and fixed it, how can I submit the patch

张立峰 lifeng.zhang at melot.cn
Wed Mar 4 11:28:20 CET 2020


Hi, everyone:


When using libwebsockets as a client to communicate a ws server, we write out many messages in a queue when receive a LWS_CALLBACK_CLIENT_WRITEABLE. This may cause the ws server to close our connection. 


We found that when lws_write return value is smaller than requested, the connection will be close when we use lws_write next time. 


After check the source code of libwebsockets, we found the issue cause:

The "wsi->ws->inside_frame" is not set to "0" after wsi->buflist_out has been sent. This will cause the wrong coded ws frame been sent.




Best wishes

Terry Zhang

2020-3-4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200304/6e9fc780/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_reset_inside_frame.diff
Type: application/octet-stream
Size: 1766 bytes
Desc: not available
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200304/6e9fc780/attachment.obj>


More information about the Libwebsockets mailing list