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 365822007D for ; Tue, 2 Feb 2021 11:47:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/16] lei_xsearch: truncate curl stderr after reading it Date: Tue, 2 Feb 2021 11:46:53 +0000 Message-Id: <20210202114702.29886-8-e@80x24.org> In-Reply-To: <20210202114702.29886-1-e@80x24.org> References: <20210202114702.29886-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We may have further URLs to read in that process, so ensure we don't end up having tail send stale data. --- lib/PublicInbox/LeiXSearch.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 95862306..5cf02136 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -268,6 +268,7 @@ sub query_remote_mboxrd { my $e = do { local $/; <$cerr> } // die "read(curl stderr): $!\n"; $coff += length($e); + truncate($cerr, 0); next if (($? >> 8) == 22 && $e =~ /\b404\b/); $lei->child_error($?); $uri->query_form(q => $lei->{mset_opt}->{qstr});