X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiXSearch.pm;h=b470c1130f60036d0f4c8d9619934825c03cec83;hb=9c1ef5c25100ad23c59404d5ca80994645f8c9c8;hp=369f6f89ecc44b99b6c9e22ee72c0994b9ecc6dd;hpb=31e7d06a8da363d72bf60fa2cd723c6b9ba3a98d;p=public-inbox.git diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 369f6f89..b470c113 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -228,10 +228,16 @@ sub query_remote_mboxrd { my $cmd = [ @cmd, $uri->as_string ]; if ($tor eq 'auto' && substr($uri->host, -6) eq '.onion' && (($env->{LD_PRELOAD}//'') !~ /torsocks/)) { - unshift @$cmd, 'torsocks'; + unshift @$cmd, which('torsocks'); } elsif (PublicInbox::Config::git_bool($tor)) { - unshift @$cmd, 'torsocks'; + unshift @$cmd, which('torsocks'); } + + # continue anyways if torsocks is missing; a proxy may be + # specified via CLI, curlrc, environment variable, or even + # firewall rule + shift(@$cmd) if !$cmd->[0]; + $lei->err("# @$cmd") if $verbose; $? = 0; my $fh = popen_rd($cmd, $env, $rdr);