[Libwebsockets] LWS_CALLBACK_RECEIVE_CLIENT_HTTP

Peter Brett pbrett_11 at yahoo.co.uk
Thu Oct 20 14:56:03 CEST 2016


I have a quick question on LWS_CALLBACK_RECEIVE_CLIENT_HTTP. This is mostly out of interest, but I'd also like to check that my understanding of this is correct:
Looking at test-client.c, where WS data is received within LWS_CALLBACK_CLIENT_RECEIVE, the received data is pointed to by 'in' with it's length in 'len'. On receipt of HTTP data on the other hand, 'len' is zero and 'in' is null, so instead a call to lws_http_client_read is made. Is there a reason for this difference?
Within the call to lws_http_client_read, there appear to be recursive calls back into the callback, the first three of which are related to shared poll arrays and the last of which is LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ, which seems to have the same semantics as LWS_CALLBACK_CLIENT_RECEIVE with the received data pointed to by 'in'.
Also is there a reason for the difference in naming convention of these two members of lws_callback_reason?

Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20161020/625d3536/attachment.html>


More information about the Libwebsockets mailing list