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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 28FCD1F5B1 for ; Sun, 5 Jul 2020 23:28:16 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 43/43] gzipfilter: check http->{forward} for client disconnects Date: Sun, 5 Jul 2020 23:27:59 +0000 Message-Id: <20200705232759.3161-44-e@yhbt.net> In-Reply-To: <20200705232759.3161-1-e@yhbt.net> References: <20200705232759.3161-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We actually don't do anything with {env} or {'psgix.io'} on client aborts, so checking the truthiness of '{forward}' is necessary. --- lib/PublicInbox/GzipFilter.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/GzipFilter.pm b/lib/PublicInbox/GzipFilter.pm index b5ad9eb88..f1354d2b7 100644 --- a/lib/PublicInbox/GzipFilter.pm +++ b/lib/PublicInbox/GzipFilter.pm @@ -165,7 +165,8 @@ sub bail { # this is public-inbox-httpd-specific sub async_blob_cb { # git->cat_async callback my ($bref, $oid, $type, $size, $self) = @_; - my $http = $self->{env}->{'psgix.io'} or return; # client abort + my $http = $self->{env}->{'psgix.io'}; + $http->{forward} or return; # client aborted my $smsg = $self->{smsg} or bail($self, 'BUG: no smsg'); if (!defined($oid)) { # it's possible to have TOCTOU if an admin runs