[Libwebsockets] problems with big dynamic content

Andy Green andy at warmcat.com
Fri Jun 22 03:41:24 CEST 2018



On 06/22/2018 09:36 AM, Per Bothner wrote:
> On 06/21/2018 05:19 PM, Andy Green wrote:
> 
>> If there's no additional set of headers waiting when the transaction 
>> completes, lws drops the ah and in case something else coming, leaves 
>> the connection open under a timeout, it's settable in 
>> info.keepalive_timeout but defaults to 5s.
>>
>> What does eg, Firefox Web Developer | Network pane think happened on 
>> window 3?
>>  It should show a list of things it asked for and what if anything 
>> arrived. 
> 
> I see nothing.   But it's weird that when I look at Network for the 
> previous terminal
> tabs only shows 4 (css files) - not even all the css files.
> 
>> What happens in the lws log while you wait 10s and when the third 
>> window opens?
> 
> Not much. This is with -d 31:
> 
> end of output after opening window 2:
> ....
> [2018/06/21 18:29:48:2084] DEBUG: 0250: 0A 0D 
> 0A                                           ...
> [2018/06/21 18:29:48:2084] DEBUG:
> [2018/06/21 18:29:48:2086] NOTICE: client connected from localhost 
> (127.0.0.1), total: 2
> [2018/06/21 18:29:48:3363] NOTICE: started process, pid: 8971

lws is chatty about what it's doing with transaction close with INFO. 
For example like this

[2018/06/22 09:33:36:3412] INFO: lws_http_transaction_completed: 
0x22778f0: nothing in buflist so detaching ah
[2018/06/22 09:33:36:3412] INFO: __lws_header_table_detach: wsi 
0x22778f0: ah 0x2277dc0 (tsi=0, count = 1)
[2018/06/22 09:33:36:3412] INFO: __lws_header_table_detach: nobody 
usable waiting
[2018/06/22 09:33:36:3412] INFO: _lws_destroy_ah: freed ah 0x2277dc0 : 
pool length 0
[2018/06/22 09:33:36:3412] INFO: __lws_header_table_detach: wsi 
0x22778f0: ah 0x2277dc0 (tsi=0, count = 0)
[2018/06/22 09:33:36:3412] INFO: lws_http_transaction_completed: 
0x22778f0: keep-alive await new transaction

Was lws built with -DCMAKE_BUILD_TYPE=DEBUG so it has info?

> count to 10, then type C-S-N, which sends an OPEN-WINDOW (domterm 
> command) to the server
> (over window 2's websocket connection).  The server then runs a command 
> like 'chrome --app=URL' or
> 'firefox URL' (depending on the initially selected browser front-end).  
> Then I see:
> 
> OPEN-WINDOW 
> 'file:///home/bothner/.domterm/default.html#geometry=800x800' geom:800x800
> [2018/06/21 18:29:55:7203] NOTICE: frontend command: 
> /usr/bin/google-chrome 
> --app='file:///home/bothner/.domterm/default.html#geometry=800x800&geometry=800x800' 
> 
> 
> and then nothing.
> 
> Both of these messages are from domterm, not the lws library.

To speed things up I will try to reproduce it... I just need to open it 
in your pattern with default build options, is it?

-Andy



More information about the Libwebsockets mailing list