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 C85B31FB07 for ; Sat, 18 Sep 2021 09:33:33 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/9] net_reader: tie SocksDebug to {imap,nntp}.Debug Date: Sat, 18 Sep 2021 09:33:28 +0000 Message-Id: <20210918093332.16054-6-e@80x24.org> In-Reply-To: <20210918093332.16054-1-e@80x24.org> References: <20210918093332.16054-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I think tying IO::Socket::Socks debugging to existing debug switches is enough, and there's no need to introduce a separate socks.Debug parameter. --- lib/PublicInbox/NetReader.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index 5725a155..e703cddb 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -35,7 +35,7 @@ sub socks_args ($) { eval { require IO::Socket::Socks } or die < $h, ProxyPort => $p }; } die "$val not understood (only socks5h:// is supported)\n"; @@ -51,6 +51,7 @@ sub mic_new ($$$$) { require IO::Socket::Socks; my %opt = %$sa; + $opt{SocksDebug} = 1 if $mic_arg{Debug}; $opt{ConnectAddr} = delete $mic_arg{Server}; $opt{ConnectPort} = delete $mic_arg{Port}; $mic_arg{Socket} = IO::Socket::Socks->new(%opt) or die @@ -170,6 +171,7 @@ sub nn_new ($$$) { my $nn; if (defined $nn_arg->{ProxyAddr}) { require PublicInbox::NetNNTPSocks; + $nn_arg->{SocksDebug} = 1 if $nn_arg->{Debug}; eval { $nn = PublicInbox::NetNNTPSocks->new_socks(%$nn_arg) }; die "E: <$uri> $@\n" if $@; } else {