From c27867da3ad7025a30e923414343262b035ed133 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 2 Feb 2021 11:46:53 +0000 Subject: [PATCH] lei_xsearch: truncate curl stderr after reading it 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}); -- 2.44.0