Make sure global timeout is *not* triggered, right after tryContactHost() succeeded.
This commit is contained in:
parent
a7b6af2111
commit
cd682bc965
@ -227,9 +227,9 @@ void MUtils::UpdateChecker::checkForUpdates(void)
|
|||||||
for(int connectionTimout = 1000; connectionTimout <= MAX_CONN_TIMEOUT; connectionTimout *= 2)
|
for(int connectionTimout = 1000; connectionTimout <= MAX_CONN_TIMEOUT; connectionTimout *= 2)
|
||||||
{
|
{
|
||||||
QElapsedTimer elapsedTimer;
|
QElapsedTimer elapsedTimer;
|
||||||
const int globalTimout = 2 * MIN_CONNSCORE * connectionTimout;
|
|
||||||
elapsedTimer.start();
|
elapsedTimer.start();
|
||||||
do
|
const qint64 globalTimeout = 2 * MIN_CONNSCORE * connectionTimout;
|
||||||
|
forever
|
||||||
{
|
{
|
||||||
if (mirrorList.isEmpty())
|
if (mirrorList.isEmpty())
|
||||||
{
|
{
|
||||||
@ -238,7 +238,7 @@ void MUtils::UpdateChecker::checkForUpdates(void)
|
|||||||
const QString hostName = mirrorList.dequeue();
|
const QString hostName = mirrorList.dequeue();
|
||||||
if (tryContactHost(hostName, connectionTimout))
|
if (tryContactHost(hostName, connectionTimout))
|
||||||
{
|
{
|
||||||
setProgress(1 + (connectionScore += 1));
|
setProgress(1 + (++connectionScore));
|
||||||
if (connectionScore >= MIN_CONNSCORE)
|
if (connectionScore >= MIN_CONNSCORE)
|
||||||
{
|
{
|
||||||
goto endLoop; /*success*/
|
goto endLoop; /*success*/
|
||||||
@ -246,11 +246,14 @@ void MUtils::UpdateChecker::checkForUpdates(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mirrorList.enqueue(hostName); /*re-schedule*/
|
mirrorList.enqueue(hostName);
|
||||||
|
if(elapsedTimer.hasExpired(globalTimeout))
|
||||||
|
{
|
||||||
|
break; /*timer expired*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CHECK_CANCELLED();
|
CHECK_CANCELLED();
|
||||||
}
|
}
|
||||||
while(!elapsedTimer.hasExpired(globalTimout));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
endLoop:
|
endLoop:
|
||||||
|
Loading…
Reference in New Issue
Block a user