From a4fa97d8ecd32927f0f3d6580c474059b59dabd2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 23 Jan 2021 10:27:47 +0000 Subject: lei: support remote externals Via curl(1), since that lets us easily use tor on a per-connection basis via LD_PRELOAD (torsocks) or proxy. We'll eventually support more curl options which can allow users to get past firewalls and deal with other odd network configurations. --- lib/PublicInbox/LeiOverview.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiOverview.pm') diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index 7a4fa857..49538a60 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -209,7 +209,15 @@ sub ovv_each_smsg_cb { # runs in wq worker usually $json->ascii(1) if $lei->{opt}->{ascii}; } my $l2m = $lei->{l2m}; - if ($l2m && $l2m->{-wq_s1}) { + if ($l2m && $ibxish->can('scheme')) { # remote https?:// mboxrd + delete $l2m->{-wq_s1}; + my $g2m = $l2m->can('git_to_mail'); + my $wcb = $l2m->write_cb($lei); + sub { + my ($smsg, undef, $eml) = @_; # no mitem in $_[1] + $wcb->(undef, $smsg, $eml); + }; + } elsif ($l2m && $l2m->{-wq_s1}) { my ($lei_ipc, @io) = $lei->atfork_parent_wq($l2m); # n.b. $io[0] = qry_status_wr, $io[1] = mbox|stdout, # $io[4] becomes a notification pipe that triggers EOF -- cgit v1.2.3-24-ge0c7