From be9e047b80f1a91492efcf92bb449d789b20edf5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 9 Sep 2021 05:24:59 +0000 Subject: net_reader: set IMAPClient Keepalive flag late Since we always enable SO_KEEPALIVE unconditionally, having it in {mic_arg} leads to unnecessary IPC overhead and memory use. --- lib/PublicInbox/NetReader.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/NetReader.pm') diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index b5d14f13..9faa362c 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -51,7 +51,7 @@ sub mic_new ($$$$) { $socks{Socket} = IO::Socket::Socks->new(%opt) or die "E: <$$uri> ".eval('$IO::Socket::Socks::SOCKS_ERROR'); } - PublicInbox::IMAPClient->new(%$mic_arg, %socks); + PublicInbox::IMAPClient->new(%$mic_arg, %socks, Keepalive => 1); } sub auth_anon_cb { '' }; # for Mail::IMAPClient::Authcallback @@ -76,7 +76,6 @@ sub mic_for ($$$$) { # mic = Mail::IMAPClient Port => $uri->port, Server => $host, Ssl => $uri->scheme eq 'imaps', - Keepalive => 1, # SO_KEEPALIVE %$common, # may set Starttls, Compress, Debug .... }; $mic_arg->{Ssl} = 1 if $uri->scheme eq 'imaps'; -- cgit v1.2.3-24-ge0c7