[Libwebsockets] latest commit breaks DomTerm's http serving

Per Bothner per at bothner.com
Tue Oct 10 19:21:48 CEST 2017


On 10/08/2017 10:53 PM, Per Bothner wrote:

> My guess is a race condition, probably in fops-zip.c.  My html file requests 5 .css files
> and 6 .js files - some pretty big. The server probably gets a request for a file before it
> has finished serving (or even reading) the previous file.

I added some print statements and got something interesting.
Focus on the 'Method:' lines.  These are from lws_http_action.
(I just copied the lwsl_info line and changed it to fprintf.)

Note how '/hlib/domterm-core.css' appears to be requested twice - in a row.
The second time it should be /hlib/domterm-standard.css.  Both
domterm-core.css and domterm-standard.css are relatively small.

So I'm guessing the bug isn't in fops-zip.c per se, but something
is messing up the request before it gets to fops-zip.c.

bin/domterm  --no-daemonize --browser
Method: 'GET' (0), request for '/hlib/domterm-core.css'
lws_http_action s:hlib/domterm-core.css hlen:1
lws_http_serve uri:hlib/domterm-core.css
lws_fops_zip_open hlib/domterm-core.css
Method: 'GET' (0), request for '/hlib/domterm-core.css'
lws_http_action s:hlib/domterm-core.css hlen:1
lws_http_serve uri:hlib/domterm-core.css
lws_fops_zip_open hlib/domterm-core.css
Method: 'GET' (0), request for '/hlib/goldenlayout-base.css'
lws_http_action s:hlib/goldenlayout-base.css hlen:1
lws_http_serve uri:hlib/goldenlayout-base.css
lws_fops_zip_open hlib/goldenlayout-base.css
Method: 'GET' (0), request for '/hlib/goldenlayout-base.css'
lws_http_action s:hlib/goldenlayout-base.css hlen:1
lws_http_serve uri:hlib/goldenlayout-base.css
lws_fops_zip_open hlib/goldenlayout-base.css
Method: 'GET' (0), request for '/hlib/domterm-default.css'
lws_http_action s:hlib/domterm-default.css hlen:1
lws_http_serve uri:hlib/domterm-default.css
lws_fops_zip_open hlib/domterm-default.css
Method: 'GET' (0), request for '/hlib/domterm-all.js'
lws_http_action s:hlib/domterm-all.js hlen:1
lws_http_serve uri:hlib/domterm-all.js
lws_fops_zip_open hlib/domterm-all.js
Method: 'GET' (0), request for '/hlib/jquery.min.js'
lws_http_action s:hlib/jquery.min.js hlen:1
lws_http_serve uri:hlib/jquery.min.js
lws_fops_zip_open hlib/jquery.min.js
Method: 'GET' (0), request for '/hlib/goldenlayout.js'
lws_http_action s:hlib/goldenlayout.js hlen:1
lws_http_serve uri:hlib/goldenlayout.js
lws_fops_zip_open hlib/goldenlayout.js
Method: 'GET' (0), request for '/hlib/domterm-layout.js'
lws_http_action s:hlib/domterm-layout.js hlen:1
lws_http_serve uri:hlib/domterm-layout.js
lws_fops_zip_open hlib/domterm-layout.js
Method: 'GET' (0), request for '/hlib/domterm-default.css'
lws_http_action s:hlib/domterm-default.css hlen:1
lws_http_serve uri:hlib/domterm-default.css
lws_fops_zip_open hlib/domterm-default.css
Method: 'GET' (0), request for '/hlib/domterm-layout.js'
lws_http_action s:hlib/domterm-layout.js hlen:1
lws_http_serve uri:hlib/domterm-layout.js
lws_fops_zip_open hlib/domterm-layout.js



-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/



More information about the Libwebsockets mailing list