In the future, I think it could be even more beneficial to
buffer to zlib (if the client accepts gzip) and bypass stdio
buffering in those cases. Smaller responses via gzip means less
IPC overhead and wakeups for the reader.
cgit is linked against zlib anyways because of git, so no extra
> index 70f5b74..2c387c1 100644
> --- a/filter.c
> +++ b/filter.c
> @@ -143,22 +145,22 @@ void cgit_init_filters(void)
> #endif
>
> #ifndef NO_LUA
> -static ssize_t (*libc_write)(int fd, const void *buf, size_t count);
> +static ssize_t (*libc_fwrite)(const void *buf, size_t size, size_t n,