[Libwebsockets] Returning -1 from client callback has no effect (LWS_CALLBACK_CLOSED isn't invoked)

"Andy Green (林安廸)" andy at warmcat.com
Sat Mar 15 02:50:38 CET 2014


On 14/03/14 14:00, the mail apparently from bjorka adinov included:
> I'm afraid if I do the patching I will mess the code up, so I hope you
> spare some time to look at it, and I appreciate it.

This seems to solve it

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=5ac7e7ad5a117699263fe283bc1e123aa2c66352

At least with the test client, closing the connection on client receive 
callback provoked a zlib data error on inflate... I couldn't see how 
this was a real problem so I quietened the report to lwsl_info at the 
same time.

-Andy

> Thank you
>
>
> On Thu, Mar 13, 2014 at 9:01 PM, Andy Green <andy at warmcat.com> wrote:
>
>>
>>
>> On 13 March 2014 17:47:49 GMT+08:00, bjorka adinov <
>> adinov.bjorka at gmail.com> wrote:
>>> Hello Andy,
>>>
>>> I'm using libwebsockets 1.23. On server side whenever I return -1 from
>>> the
>>> callback, the connection is closed and LWS_CALLBACK_CLOSED is invoked
>>> on
>>> both side. But when  I return -1 from client side callback, nothing
>>> happened. LWS_CALLBACK_CLOSED is not invoked. When I debug the code, it
>>> seems the callback function is called from function
>>> libwebsocket_client_rx_sm (client-parser.c) line 396 and the return
>>> value
>> >from the callback function is not used ? Is this by design ? Am I
>>> missing
>>> something ?
>>
>> It's probably simply missing the code to take care of it, the server code
>> gets a lot more attention.
>>
>> Patch is welcome or if you can wait until Saturday I will take a look at
>> it.
>>
>> -Andy
>>
>>> Thanks a lot
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Libwebsockets mailing list
>>> Libwebsockets at ml.libwebsockets.org
>>> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
>>
>>
>




More information about the Libwebsockets mailing list