httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Robert S. Thau)
Subject Re: HTTP/1.1
Date Fri, 31 May 1996 21:04:16 GMT
  Anyone got any idea how we actually implement this?

My threaded server code does a shutdown(1) on the socket, and then
waits until EOF is seen on the read side; I think that's the best you
can do with the socket API.  (The way this is arranged internally, the
only resources the server has committed to the connection between the
shutdown and the final close are the file descriptor itself, and a
~24-byte entry in a table maintained by http_main.c --- there's no
point tying up RAM to hold the stack of a thread that has no more
useful work to do.  Long-lived keepalive connections get similar
treatment; if a new request does come in, of course, a thread is
spawned off to handle it.  When the moon is right, it even works ;-).


View raw message