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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 AB3041F6A3 for ; Sat, 10 Sep 2022 08:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662797937; bh=K4AO+Tiff31TOkPQ28JzQiXIqN7URDdupZfTRMRePjw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=1ktHHAFJXtsc3ds9SbTDl6QjgznecdBB5YLO0VWlttiVc2xc1J8QXdniRz6fd/N9L 6nMCvXMvqCBVouvv7Li18Xcl3pCdqJeM+IWwRA9/rKPpgih0pZurIo35Uaf4q+I7Vs r6fHjQmVb8SQyX8ZfZXLwaPP0Hq8350Q9hyzCI8E= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 32/38] httpd/async: describe which ->write subs it can call Date: Sat, 10 Sep 2022 08:17:23 +0000 Message-Id: <20220910081729.2011934-33-e@80x24.org> In-Reply-To: <20220910081729.2011934-1-e@80x24.org> References: <20220910081729.2011934-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I initially wanted to rename GzipFilter->write to GzipFilter->writev to reflect the multi-argument nature of the sub, and it wasn't worth the memory to maintain an alias. --- lib/PublicInbox/HTTPD/Async.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm index 1651da88..cb76cfab 100644 --- a/lib/PublicInbox/HTTPD/Async.pm +++ b/lib/PublicInbox/HTTPD/Async.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # # XXX This is a totally unstable API for public-inbox internal use only @@ -77,8 +77,11 @@ sub async_pass { # will automatically close this ($self) object. $http->{forward} = $self; - # write anything we overread when we were reading headers - $fh->write($$bref); # PublicInbox:HTTP::{chunked,identity}_wcb + # write anything we overread when we were reading headers. + # This is typically PublicInbox:HTTP::{chunked,identity}_wcb, + # but may be PublicInbox::GzipFilter::write. PSGI requires + # *_wcb methods respond to ->write (and ->close), not ->print + $fh->write($$bref); # we're done with this, free this memory up ASAP since the # calls after this may use much memory: