about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-19 12:50:34 +0000
committerEric Wong <e@80x24.org>2021-09-19 19:53:05 +0000
commit5b6757c675e41b6d464bfb2ccfa7967a55daa314 (patch)
tree11592df7afcd75f60e1273ac6f8d0905025ec44a /lib
parent9d0f17840479508de4aaf76fe6c150e94a9f79c3 (diff)
downloadpublic-inbox-5b6757c675e41b6d464bfb2ccfa7967a55daa314.tar.gz
A batch size of zero is nonsensical and causes infinite loops.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/NetReader.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index e305523e..fbe1ac4f 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -344,10 +344,10 @@ sub imap_common_init ($;$) {
                 }
                 my $k = 'imap.fetchBatchSize';
                 my $bs = $cfg->urlmatch($k, $$uri) // next;
-                if ($bs =~ /\A([0-9]+)\z/) {
+                if ($bs =~ /\A([0-9]+)\z/ && $bs > 0) {
                         $self->{cfg_opt}->{$sec}->{batch_size} = $bs;
                 } else {
-                        warn "$k=$bs is not an integer\n";
+                        warn "$k=$bs is not a positive integer\n";
                 }
         }
         # make sure we can connect and cache the credentials in memory