From 2a840113513b1b5cbdd7dec1edc9c63d5a863310 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Mon, 20 Apr 2009 15:13:03 +0000 Subject: Testing network connectivity several times before reporting error (#50098, #49574). --- lib/network/netconnect.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm index f344b34..895ed0a 100644 --- a/lib/network/netconnect.pm +++ b/lib/network/netconnect.pm @@ -309,6 +309,7 @@ If you do not know it, keep the preselected protocol.") }, if ($answer) { $connection->disconnect; $connection->connect; + # TODO: we should have some graphical notification for these tests #- FIXME: should use network::test for ppp (after future merge with network::connection) #- or start interface synchronously if (!$::isInstall) { @@ -322,7 +323,13 @@ If you do not know it, keep the preselected protocol.") }, } } $success = $connection->get_status(); - $has_internet = network::tools::connected(); + # try to resolve the network address for some time + my $timeout = 3; + while ($timeout--) { + $has_internet = network::tools::connected(); + last if $has_internet; + sleep 1; + } } "end"; #- handle disconnection in install? }, -- cgit v1.2.1