From: Michael Tremer Date: Sat, 28 Dec 2013 16:06:38 +0000 (+0100) Subject: pakfire: Prevent an infinite loop with empty server list. X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=63efc01c84a5f559858d0d46cb7c5a2212486567 pakfire: Prevent an infinite loop with empty server list. --- diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 133b4950f..d14e0314d 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -305,7 +305,12 @@ sub selectmirror { } } logger("MIRROR INFO: $scount servers found in list"); - + + if ($scount eq 0) { + logger("MIRROR INFO: Could not find any servers. Falling back to main server $Conf::mainserver"); + return ("HTTP", $Conf::mainserver, "/$Conf::version"); + } + ### Choose a random server and test if it is online # If the check fails try a new server. # This will never give up.