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 37AB91F9FD; Wed, 24 Feb 2021 23:25:46 +0000 (UTC) Date: Wed, 24 Feb 2021 23:25:46 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH 5/4] net_reader: do not warn on EINTR if user quit Message-ID: <20210224232546.GA18837@dcvr> References: <20210224113154.686-1-e@80x24.org> <20210224113154.686-4-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210224113154.686-4-e@80x24.org> List-Id: This fixes an occasional test failure in t/imapd.t --- lib/PublicInbox/NetReader.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index 462514ed..96d3b2ed 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -408,8 +408,10 @@ sub _imap_fetch_all ($$$) { # I wish "UID FETCH $START:*" could work, but: # 1) servers do not need to return results in any order # 2) Mail::IMAPClient doesn't offer a streaming API - $uids = $mic->search("UID $l_uid:*") or + unless ($uids = $mic->search("UID $l_uid:*")) { + return if $!{EINTR} && $self->{quit}; return "E: $uri UID SEARCH $l_uid:* error: $!"; + } return if scalar(@$uids) == 0; # RFC 3501 doesn't seem to indicate order of UID SEARCH @@ -431,6 +433,7 @@ sub _imap_fetch_all ($$$) { local $0 = "UID:$batch $mbx $sec"; my $r = $mic->fetch_hash($batch, $req, 'FLAGS'); unless ($r) { # network error? + last if $!{EINTR} && $self->{quit}; $err = "E: $uri UID FETCH $batch error: $!"; last; }