diff options
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm')
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm index e0bad45461..5d0f8490d1 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLDownload.pm @@ -1,6 +1,6 @@ -# $Id: TLDownload.pm 54993 2020-05-03 21:57:54Z karl $ +# $Id: TLDownload.pm 57809 2021-02-20 21:55:13Z karl $ # TeXLive::TLDownload.pm - module for abstracting the download modes -# Copyright 2009-2020 Norbert Preining +# Copyright 2009-2021 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. @@ -9,7 +9,7 @@ package TeXLive::TLDownload; use TeXLive::TLUtils; use TeXLive::TLConfig; -my $svnrev = '$Revision: 54993 $'; +my $svnrev = '$Revision: 57809 $'; my $_modulerevision; if ($svnrev =~ m/: ([0-9]+) /) { $_modulerevision = $1; @@ -48,23 +48,38 @@ sub new -sub reinit -{ +sub reinit { my $self = shift; + + # Irritatingly, as of around version 6.52, when env_proxy is set, LWP + # started unconditionally complaining if the environment contains + # differing case-insensitive like foo=1 and FOO=2. Even on systems + # that have case-sensitive environments, and even about variables that + # have nothing whatsoever to do with LWP (like foo). + # + # So, only pass env_proxy=>1 when creating the UserAgent if there are + # in fact *_proxy variables (case-insensitive, just in case) set in + # the environment. + # + my @env_proxy = (); + if (grep { /_proxy/i } keys %ENV ) { + @env_proxy = ("env_proxy", 1); + } + # my $ua = LWP::UserAgent->new( agent => "texlive/lwp", # use LWP::ConnCache, and keep 1 connection open keep_alive => 1, - env_proxy => 1, timeout => $TeXLive::TLConfig::NetworkTimeout, + @env_proxy, ); $self->{'ua'} = $ua; $self->{'enabled'} = 1; $self->{'errorcount'} = 0; $self->{'initcount'} += 1; } -sub enabled -{ + +sub enabled { my $self = shift; return $self->{'enabled'}; } |