user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/8] net_reader: preserve memoized IMAPClient arg for SOCKS
  2021-09-09  5:24  7% [PATCH 0/8] net_reader: simplify + fix bugs Eric Wong
@ 2021-09-09  5:25  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-09-09  5:25 UTC (permalink / raw)
  To: meta

Multiple invocations of mic_new may happen in long-lived
processes, so do not let mic_new make irreversible changes
to the cached args when using a SOCKS proxy.
---
 lib/PublicInbox/NetReader.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index 9faa362c..5199a3a3 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -42,16 +42,16 @@ EOM
 
 sub mic_new ($$$$) {
 	my ($self, $mic_arg, $sec, $uri) = @_;
-	my %socks;
+	my %mic_arg = %$mic_arg;
 	my $sa = $self->{imap_opt}->{$sec}->{-proxy_cfg} || $self->{-proxy_cli};
 	if ($sa) {
 		my %opt = %$sa;
-		$opt{ConnectAddr} = delete $mic_arg->{Server};
-		$opt{ConnectPort} = delete $mic_arg->{Port};
-		$socks{Socket} = IO::Socket::Socks->new(%opt) or die
+		$opt{ConnectAddr} = delete $mic_arg{Server};
+		$opt{ConnectPort} = delete $mic_arg{Port};
+		$mic_arg{Socket} = IO::Socket::Socks->new(%opt) or die
 			"E: <$$uri> ".eval('$IO::Socket::Socks::SOCKS_ERROR');
 	}
-	PublicInbox::IMAPClient->new(%$mic_arg, %socks, Keepalive => 1);
+	PublicInbox::IMAPClient->new(%mic_arg, Keepalive => 1);
 }
 
 sub auth_anon_cb { '' }; # for Mail::IMAPClient::Authcallback

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/8] net_reader: simplify + fix bugs
@ 2021-09-09  5:24  7% Eric Wong
  2021-09-09  5:25  7% ` [PATCH 3/8] net_reader: preserve memoized IMAPClient arg for SOCKS Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-09-09  5:24 UTC (permalink / raw)
  To: meta

What started off as a series of cleanups leads to some minor bug
fixes for some uncommon corner-cases.  These changes will
hopefully simplify IPC for sharing auth with lei/store and
IMAP IDLE watchers.

Eric Wong (8):
  net_reader: do not set "SSL" fields for non-TLS
  net_reader: set IMAPClient Keepalive flag late
  net_reader: preserve memoized IMAPClient arg for SOCKS
  net_reader: nntp_opt => cfg_opt
  net_reader: imap_opt => cfg_opt
  net_reader: combine Net::NNTP and IMAPClient args
  net_reader: improve naming of common args
  net_reader: support Mail::IMAPClient Ignoresizeerrors

 lib/PublicInbox/NetReader.pm | 94 ++++++++++++++++++------------------
 lib/PublicInbox/Watch.pm     | 10 ++--
 2 files changed, 53 insertions(+), 51 deletions(-)

^ permalink raw reply	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-09-09  5:24  7% [PATCH 0/8] net_reader: simplify + fix bugs Eric Wong
2021-09-09  5:25  7% ` [PATCH 3/8] net_reader: preserve memoized IMAPClient arg for SOCKS Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).