From 0df6f43c81c72924020b8f71c696784f154d93fa Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Feb 2021 23:05:09 -1000 Subject: lei q: improve remote mboxrd UX + MUA For early MUA spawners using lock-free outputs, we we need to on the startq pipe to silence progress reporting. For --augment users, we can start the MUA even earlier by creating Maildirs in the pre-augment phase. To improve progress reporting for non-MUA (or late-MUA) spawners, we'll no longer blindly append "--compressed" to the curl(1) command when POST-ing for the gzipped mboxrd. Furthermore, we'll overload stringify ('""') in LeiCurl to ensure the empty -d '' string shows up properly. v2: fix startq waiting with --threads mset_progress is never shown with early MUA spawning, The plan is to still show progress when augmenting and deduping. This fixes all local search cases. A leftover debug bit is dropped, too --- lib/PublicInbox/LeiCurl.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/LeiCurl.pm') diff --git a/lib/PublicInbox/LeiCurl.pm b/lib/PublicInbox/LeiCurl.pm index 38b17c78..f346a1b4 100644 --- a/lib/PublicInbox/LeiCurl.pm +++ b/lib/PublicInbox/LeiCurl.pm @@ -8,6 +8,12 @@ use v5.10.1; use PublicInbox::Spawn qw(which); use PublicInbox::Config; +# Ensures empty strings are quoted, we don't need more +# sophisticated quoting than for empty strings: curl -d '' +use overload '""' => sub { + join(' ', map { $_ eq '' ? "''" : $_ } @{$_[0]}); +}; + my %lei2curl = ( 'curl-config=s@' => 'config|K=s@', ); @@ -63,10 +69,9 @@ EOM # completes the result of cmd() for $uri sub for_uri { - my ($self, $lei, $uri) = @_; + my ($self, $lei, $uri, @opt) = @_; my $pfx = torsocks($self, $lei, $uri) or return; # error - [ @$pfx, @$self, substr($uri->path, -3) eq '.gz' ? () : '--compressed', - $uri->as_string ] + bless [ @$pfx, @$self, @opt, $uri->as_string ], ref($self); } 1; -- cgit v1.2.3-24-ge0c7