]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_xsearch: truncate curl stderr after reading it
authorEric Wong <e@80x24.org>
Tue, 2 Feb 2021 11:46:53 +0000 (11:46 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Feb 2021 07:32:37 +0000 (07:32 +0000)
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

index 95862306cd7a98beba3aca94659f17bd7bf3460a..5cf02136ba42ae012182e37f64892ce08a2ae26e 100644 (file)
@@ -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});