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). --- NEWS | 3 +++ lib/network/netconnect.pm | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1911817..00b3d90 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- connection manager: + o test for network conectivity several times before reporting error + (#50098, #49574) - cellular backend: o added support for Brazilian VIVO provider. 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