about summary refs log tree commit homepage
path: root/lib/PublicInbox/HTTPD/Async.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-10 08:17:23 +0000
committerEric Wong <e@80x24.org>2022-09-10 19:50:52 +0000
commitc48461bffcbac4cf4c400e1edabc6da528cc45d3 (patch)
treec444c6d48b51fea1226a48a578d9a95a051a808d /lib/PublicInbox/HTTPD/Async.pm
parentee098bc50cc61538ea22264df951855ed09736ec (diff)
downloadpublic-inbox-c48461bffcbac4cf4c400e1edabc6da528cc45d3.tar.gz
httpd/async: describe which ->write subs it can call
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.
Diffstat (limited to 'lib/PublicInbox/HTTPD/Async.pm')
-rw-r--r--lib/PublicInbox/HTTPD/Async.pm9
1 files 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 <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # 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: