From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6B5B81FB00 for ; Thu, 15 Dec 2022 20:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1671137579; bh=r4Dbs/GdgtzgqTx5xFz3VoEBV3oXh60/RUfIAogEexQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eNkbQahTPhY7uW+AcgKRf2K+shvRz8e1DOsfvHXB8Lt0exGUL8OtfRdFTu5558Zcs 1wTpIlqHRQbVgOG63NKini4Q7XK8yKdZrvZgBhkZP075SFj/J0v0zzs67wHVECq5cL xOB/EHlS6E34ThkIxMxiV2gGoD3zaiXFeR6BIXec= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 17/19] httpd: describe simple and naive buffering scheme Date: Thu, 15 Dec 2022 20:52:53 +0000 Message-Id: <20221215205255.27840-18-e@80x24.org> In-Reply-To: <20221215205255.27840-1-e@80x24.org> References: <20221215205255.27840-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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