lpereira / lwan

Experimental, scalable, high performance HTTP server

Home Page:https://lwan.ws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

delay when browsing lwan via w3m

diviaki opened this issue · comments

Compiled lwan (Debian) and browsing a static, trivial hello_world.html file with w3m, via http takes about 16 secs to display. All my htmls are delayed like that.
Desktop browsers, links, wget, curl works just fine.

Putting an nginx proxy before lwan solves the issue.
It's not a DNS nor a IPv6 issue (glitches when browsing 127.0.0.1).
Looks like w3m is faulty but then lwan.ws (only lwan site I found exposed to the internet) works great with w3m. Though it's an https, not a http site.

What the heck could be behind this?

That's indeed odd! I'll see if I can reproduce this... and I suspect I'll have to spend some quality time with strace to figure this one out.

(And, BTW, although lwan.ws is served by Lwan, it's behind a Varnish as reverse proxy/cache + Hitch TLS terminator, so it's not odd at all that if nginx as proxy makes the whole thing work.)

I figured what's happening. W3M is using HTTP/1.0, and, although Lwan is sending a Connection: close header, as it should, it keeps the connection open until the timer expires and the connection closes. As soon as the connection closes, W3M displays the content. The fix should be simple.

This has been closed automatically because of the commit message, but it seems to work fine for me. I would appreciate if you could confirm.

Works for me too. That was really fast. Thumbs up!