diff options
Diffstat (limited to 'tools/server/http.c')
| -rw-r--r-- | tools/server/http.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/server/http.c b/tools/server/http.c index a1d347f..6fc21f0 100644 --- a/tools/server/http.c +++ b/tools/server/http.c @@ -1,3 +1,16 @@ +/* HTTP/1.1 connection lifecycle, header parsing, and response framing. + * + * - One refcounted client per connection. + * - The event loop holds a reference while the socket is open; the worker thread + * holds one while a job from that connection is in flight. + * - If a request completes after the peer disconnects, the client is still freed + * safely. + * - read_cb accumulates bytes until a full request is framed, then hands it to + * dispatch_request in server.c. + * - write_cb drains the response, then either closes the connection or arms the + * next pipelined request. + */ + #include "server_internal.h" #include "util.h" @@ -11,17 +24,6 @@ #include <sys/types.h> #include <unistd.h> -/* ======================================================================== - * HTTP/1.1 connection lifecycle, header parsing, and response framing - * - * One client per connection, refcounted: the event loop holds a reference - * while the socket is open and the worker thread holds one while a job derived - * from the connection is in flight, so a request that completes after the peer - * disconnects frees the client safely. read_cb accumulates bytes until a full - * request is framed, then hands off to dispatch_request (server.c); write_cb - * drains the response and either closes or arms the next pipelined request. - * ======================================================================== */ - int set_nonblock(int fd) { int flags = fcntl(fd, F_GETFL, 0); if (flags < 0) |
