diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-06-27 00:58:05 +0200 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-06-27 01:03:41 +0200 |
| commit | af55803d0dff9eb692c760c8d486e736c945061d (patch) | |
| tree | 0875a1112bf98304e445e0544c4309670d6f4769 /tools/server/http.c | |
| parent | 0f861b7f3098750ddee4f6570f3be228d1da5320 (diff) | |
| download | ffwd-af55803d0dff9eb692c760c8d486e736c945061d.tar.gz ffwd-af55803d0dff9eb692c760c8d486e736c945061d.zip | |
chore: clean up comment formatting and wording
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) |
