[Libwebsockets] latest commit breaks DomTerm's http serving

Andy Green andy at warmcat.com
Thu Oct 12 05:54:44 CEST 2017



On 10/12/2017 11:16 AM, Andy Green wrote:
> 
> 
> On 10/12/2017 09:03 AM, Per Bothner wrote:
>> ./configure --with-libwebsockets=/path/to/libwebsockets/build 
>> --without-qtwebengine --without-java
> 
> I tried this, but I met a couple of problems.
> 
>   - lws wants libcap if it exists on your system but the link line
> 
> gcc  -I/usr/include/json-c  -I./lws-term 
> -I/projects/libwebsockets/build/include 
> -DRESOURCE_DIR='"../share/domterm"' -g -O2   -o ldomterm 
> ldomterm-server.o ldomterm-utils.o ldomterm-protocol.o ldomterm-http.o 
> ldomterm-whereami.o ldomterm-junzip.o 
> /projects/libwebsockets/build/lib/libwebsockets.a -lssl -lcrypto 
> -ljson-c  -lpthread -lutil -lz
> 
> didn't include it.
> 
>   - when I started ./bin/domterm, firefox segfaulted.
> 
> I'll try provoking http/1.1 pipeling generally, first without involving 
> the zlib stuff.

Disabling HTTP/2 and running this

  $ wget -O/tmp/lwsdump http://localhost:7681/test.html 
http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png 
http://localhost:7681/test.html http://localhost:7681/http2.png 
http://localhost:7681/libwebsockets.org-logo.png

...while definitely using HTTP/1.1 pipelining...

...
Reusing existing connection to [localhost]:7681.
...

only gets me what I expect

lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /test.html 
http/1.1" 200 67010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET /http2.png 
http/1.1" 200 7700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[16349]: ::1 - - [12/Oct/2017:11:22:22 +0800] "GET 
/libwebsockets.org-logo.png http/1.1" 200 7166 "" "Wget/1.19.1 (linux-gnu)"

It's also OK when I do a similar test with things from the candide.zip 
example using the test-server-v2.0 with https

$ for i in 1 2 3 4 5 6 7 8 ; do wget --no-check-certificate 
-O/tmp/lwsdump http://127.0.0.1:7681/ziptest/candide.html 
http://127.0.0.1:7681/ziptest/images/001_th.jpg 
http://127.0.0.1:7681/ziptest/images/002_th.jpg 
http://127.0.0.1:7681/ziptest/candide.html 
http://127.0.0.1:7681/ziptest/images/001_th.jpg 
http://127.0.0.1:7681/ziptest/images/002_th.jpg ; done

lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/candide.html http/1.1" 200 262700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/images/001_th.jpg http/1.1" 200 60010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/images/002_th.jpg http/1.1" 200 57079 "" "Wget/1.19.1 (linux-gnu)"
lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/candide.html http/1.1" 200 262700 "" "Wget/1.19.1 (linux-gnu)"
lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/images/001_th.jpg http/1.1" 200 60010 "" "Wget/1.19.1 (linux-gnu)"
lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/images/002_th.jpg http/1.1" 200 57079 "" "Wget/1.19.1 (linux-gnu)"
lwsts[18972]: ::ffff:127.0.0.1 - - [12/Oct/2017:11:52:59 +0800] "GET 
/ziptest/candide.html http/1.1" 200 262700 "" "Wget/1.19.1 (linux-gnu)"
...


-Andy

> -Andy
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets



More information about the Libwebsockets mailing list