unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#36350: [2.2.5] ‘read-headers’ blocks, thereby breaking web servers
@ 2019-06-24 10:32 Ludovic Courtès
  2019-06-24 12:05 ` Dan Frumin
  2019-06-24 15:36 ` Mark H Weaver
  0 siblings, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-06-24 10:32 UTC (permalink / raw)
  To: 36350

Hello,

In Guile 2.2.5, if you run:

  ./meta/guile examples/web/hello.scm &
  wget -O - http://localhost:8080

You’ll notice that ‘wget’ hangs (never receives a response) because the
server is actually stuck in a read(2) call that will never complete, in
‘read-headers’.

Reverting 73cde5ed7218a090ecee888870908af5445796f0 solves the problem.

AIUI, before that commit, ‘read-header-line’ would read exactly one
line.  After this change, it calls ‘lookahead-char’, which can block,
and that’s exactly what’s happening here.

I don’t know how HTTP continuation lines work, so I’m not sure what a
correct fix would look like.  Mark, WDYT?

I also noticed that there are no unit tests for (web server), which we
should probably address while we’re at it.  :-)

Thanks,
Ludo’.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-30 19:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 10:32 bug#36350: [2.2.5] ‘read-headers’ blocks, thereby breaking web servers Ludovic Courtès
2019-06-24 12:05 ` Dan Frumin
2019-06-24 12:44   ` Dan Frumin
2019-06-24 15:36 ` Mark H Weaver
2019-06-24 18:56   ` Ludovic Courtès
2019-06-25  7:22     ` Mark H Weaver
2019-06-30 19:50       ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).