[Libwebsockets] client issue?

Andy Green andy at warmcat.com
Thu Feb 9 02:15:39 CET 2017



On 02/09/2017 09:12 AM, Joel Winarske wrote:
> Operator error.  It works great now.
>
> I just needed to implement LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ to 
> handle the chunks.

Ha... yes that is right... I was sat here improving the test client to 
do it and documenting the function better.  It should do it and explain 
how to do it better it's not really operator error.

The reason is when in chunking transfer mode,  the chunking headers are 
inline with the data, it has to send separate buffer / length chunks for 
each chunk or partial chunk.

I'll push it in a few minutes.

-Andy

>
> On Wed, Feb 8, 2017 at 12:40 PM, Joel Winarske 
> <joel.winarske at gmail.com <mailto:joel.winarske at gmail.com>> wrote:
>
>     I added a printout of the return value from lws_ssl_capable_read()
>     in lws_http_client_read, and it reports what looks like a sane value.
>
>
>     On Wed, Feb 8, 2017 at 11:38 AM, Joel Winarske
>     <joel.winarske at gmail.com <mailto:joel.winarske at gmail.com>> wrote:
>
>         In the below scenario I was figuring I should see nine
>         different LWS_CALLBACK_RECEIVE_CLIENT_HTTP callbacks, as well
>         as valid read lengths.  Am I missing something?
>
>         $ ./libwebsockets-test-client http://inrix.com
>         ...
>         [2017/02/08 08:58:26:9465] NOTICE: http: connecting
>         [2017/02/08 08:58:26:9575] NOTICE: dumb:
>         LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER
>         [2017/02/08 08:58:26:9662] NOTICE: dumb:
>         LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP 200
>         [2017/02/08 08:58:26:9663] NOTICE:
>         lws_client_interpret_server_handshake: client connection up
>         [2017/02/08 08:58:26:9663] NOTICE: dumb:
>         LWS_CALLBACK_RECEIVE_CLIENT_HTTP
>         [2017/02/08 08:58:26:9663] NOTICE: lws_http_client_read len=0
>         [2017/02/08 08:58:26:9681] NOTICE: dumb:
>         LWS_CALLBACK_RECEIVE_CLIENT_HTTP
>         [2017/02/08 08:58:26:9682] NOTICE: lws_http_client_read len=0
>         [2017/02/08 08:58:26:9701] NOTICE: dumb:
>         LWS_CALLBACK_RECEIVE_CLIENT_HTTP
>         [2017/02/08 08:58:26:9701] NOTICE: lws_http_client_read len=0
>         [2017/02/08 08:58:26:9720] NOTICE: dumb:
>         LWS_CALLBACK_RECEIVE_CLIENT_HTTP
>         [2017/02/08 08:58:26:9721] NOTICE: lws_http_client_read len=0
>         [2017/02/08 08:58:26:9738] NOTICE: dumb:
>         LWS_CALLBACK_RECEIVE_CLIENT_HTTP
>         [2017/02/08 08:58:26:9739] NOTICE: dumb:
>         LWS_CALLBACK_COMPLETED_CLIENT_HTTP
>         [2017/02/08 08:58:26:9739] NOTICE: lws_http_client_read len=3
>
>
>         [2017/02/08 08:58:26:9739] ERR: Exiting
>         [2017/02/08 08:58:26:9739] NOTICE: lws_context_destroy: ctx
>         0x1d01990
>         [2017/02/08 08:58:26:9739] NOTICE: lws_context_destroy2: ctx
>         0x1d01990
>
>
>         In wireshark for the above I saw eight TCP packets with the
>         following lengths - 4104, 2736, 2736, 2736, 5472, 1368, 4104,
>         1851.
>
>
>         Joel
>
>
>
>
>
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list