]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/pakfire/lib/functions.pl
pakfire: Prevent an infinite loop with empty server list.
[people/teissler/ipfire-2.x.git] / src / pakfire / lib / functions.pl
index 133b4950f49a860557f3492edfea7bf5802906fc..d14e0314da05e1a7bfd5377cd7811c1812e22afd 100644 (file)
@@ -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.