From c4f00a0973191a11fbe509d9afca1ee20085e79e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 6 Mar 2020 00:59:56 +0000 Subject: LWP - re-establish connection in case it got disabled After 5 (TLConfig::LWPMaxErrors) errors, the LWP module is getting disabled. Re-establish a new connection and enable LWP to get higher throughput. To make sure that this doesn't loop, we limit the number of re-enabling to 10 (TLConfig::MaxLWPReinitCount) git-svn-id: svn://tug.org/texlive/trunk@54123 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Master/tlpkg/TeXLive/TLUtils.pm') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 14de29c8f4c..e78f9001a53 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -3853,7 +3853,16 @@ false. sub setup_persistent_downloads { if ($TeXLive::TLDownload::net_lib_avail) { ddebug("setup_persistent_downloads has net_lib_avail set\n"); - $::tldownload_server = TeXLive::TLDownload->new; + if ($::tldownload_server) { + if ($::tldownload_server->initcount() > $TeXLive::TLConfig::MaxLWPReinitCount) { + debug("stop retrying to initialize LWP after 10 failures\n"); + return 0; + } else { + $::tldownload_server->reinit(); + } + } else { + $::tldownload_server = TeXLive::TLDownload->new; + } if (!defined($::tldownload_server)) { ddebug("TLUtils:setup_persistent_downloads: failed to get ::tldownload_server\n"); } else { -- cgit v1.2.3