From dcafd48df9d57198943669412fcd98b9f958b3b7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 15 Dec 2022 20:52:53 +0000 Subject: httpd: describe simple and naive buffering scheme Better to have one implementation which works for all clients, since curl may not be as readily available as socat or a naive Perl socket implementation. --- httpd.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/httpd.h b/httpd.h index 4864e72..58db400 100644 --- a/httpd.h +++ b/httpd.h @@ -8,6 +8,15 @@ * * stdio (via open_memstream) is used for all vector management, * thus everything is a `FILE *' + * + * Buffering is naive: write in full to a memstream to get an accurate + * Content-Length, then write out the header and sendmsg it off. + * I'm avoiding a streaming + lazy buffering design based on fopencookie(3) + * since that adds more complexity and uses icache. + * Supporting gzip would be nice, but linking zlib is not an option since + * there's a risk of conflicts if the application links against a different + * zlib version. posix_spawn+gzip isn't an option, either, since we don't + * want to generate intrusive SIGCHLD. */ #ifndef _DEFAULT_SOURCE # define _DEFAULT_SOURCE -- cgit v1.2.3-24-ge0c7