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-ASN: 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 CA17F1F8C8 for ; Thu, 9 Sep 2021 05:25:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/8] net_reader: do not set "SSL" fields for non-TLS Date: Thu, 9 Sep 2021 05:24:58 +0000 Message-Id: <20210909052505.7174-2-e@80x24.org> In-Reply-To: <20210909052505.7174-1-e@80x24.org> References: <20210909052505.7174-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This will save a little bit of memory and IPC I/O for users connecting to localhost and the majority of Tor .onions. --- lib/PublicInbox/NetReader.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index 08166415..b5d14f13 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -79,6 +79,7 @@ sub mic_for ($$$$) { # mic = Mail::IMAPClient Keepalive => 1, # SO_KEEPALIVE %$common, # may set Starttls, Compress, Debug .... }; + $mic_arg->{Ssl} = 1 if $uri->scheme eq 'imaps'; require PublicInbox::IMAPClient; my $mic = mic_new($self, $mic_arg, $sec, $uri) or die "E: <$uri> new: $@\n"; @@ -197,9 +198,9 @@ sub nn_for ($$$$) { # nn = Net::NNTP my $nn_arg = { Port => $uri->port, Host => $host, - SSL => $uri->secure, # snews == nntps %$common, # may Debug .... }; + $nn_arg->{SSL} = 1 if $uri->secure; # snews == nntps my $sa = $self->{-proxy_cli}; %$nn_arg = (%$nn_arg, %$sa) if $sa; my $nn = nn_new($nn_arg, $nntp_opt, $uri);