about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-12-15 20:52:53 +0000
committerEric Wong <mwrap-perl@80x24.org>2022-12-16 09:27:48 +0000
commitdcafd48df9d57198943669412fcd98b9f958b3b7 (patch)
tree98e21c8a777b736df82528bfd34541aab19f0ab6
parentcf2e3db35163031206e94e9e76b23acc2136d1a1 (diff)
downloadmwrap-dcafd48df9d57198943669412fcd98b9f958b3b7.tar.gz
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.
-rw-r--r--httpd.h9
1 files changed, 9 insertions, 0 deletions
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