[Libwebsockets] please document lws_callback_function return codes

Per Bothner per at bothner.com
Wed Sep 1 05:40:10 CEST 2021



On 8/31/21 7:12 PM, Andy Green wrote:
> 
> 
> On 8/31/21 6:27 PM, Per Bothner wrote:
>> I had problems remembering the return values for the protocal
>> callback functions, and I couldn't find it in the documentation.
>>
>> Can I suggest adding a \return comment for lws_callback_function
>> in lws-callbacks.h?
> 
> Almost all of them will say the same, return 0 if no problem else nonzero to close.

In that case, perhaps the document comment could say that?

Maybe:

\return Should return 0 in the normal case; a return value of -1 requests that the connection be closed.
Exceptions are documented for specific values of the reason argument.

Or perhaps:

\return The meaning of the return value depends on the reason argument.
See documentation for each enum lws_callback_reason value.
Unless otherwise specified, return 0 in the normal case;
a return value of -1 requests that the connection be closed.
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/


More information about the Libwebsockets mailing list