From 213bfb9b9ebc485002cc3d5dde449d389d4b52a5 Mon Sep 17 00:00:00 2001 From: "ssu%netscape.com" Date: Fri, 11 Apr 2003 07:32:00 +0000 Subject: [PATCH] fixing bug 197847 - Too many network errors should pause install, not automatically cancel it. r=dveditz, rs=sspitzer --- xpinstall/packager/windows/config.it | 2 +- xpinstall/wizard/windows/setup/setup.h | 4 ++-- xpinstall/wizard/windows/setup/xpnetHook.cpp | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/xpinstall/packager/windows/config.it b/xpinstall/packager/windows/config.it index 57c91832cbef..55b89baccbd5 100644 --- a/xpinstall/packager/windows/config.it +++ b/xpinstall/packager/windows/config.it @@ -1133,7 +1133,7 @@ Error Corrupted Archives Detected AUTO mode=Setup has detected that at least one ;*** LOCALIZE ME BABY *** Error Too Many CRC Failures=Too many download failures. Setup will cancel. Any files already downloaded will not be deleted. The next time Setup is run, these files will be taken into account during the download. ;*** LOCALIZE ME BABY *** -Error Too Many Network Errors=Too many network errors trying to download %s. Please retry again later. Any files already downloaded will not be deleted. The next time Setup is run, these files will be taken into account during the download. +Error Too Many Network Errors=Too many network errors trying to download %s. Setup will now Pause. Please click Resume to retry downloading the files. ;*** LOCALIZE ME BABY *** Message Verifying Archives=Verifying integrity of archives, please wait... ;*** LOCALIZE ME BABY *** diff --git a/xpinstall/wizard/windows/setup/setup.h b/xpinstall/wizard/windows/setup/setup.h index a76d2a2f66c7..0c1565a558a8 100644 --- a/xpinstall/wizard/windows/setup/setup.h +++ b/xpinstall/wizard/windows/setup/setup.h @@ -100,8 +100,8 @@ typedef int PRInt32; #define PREV_DLG 2 #define OTHER_DLG_1 3 -#define MAX_CRC_FAILED_DOWNLOAD_RETRIES 3 -#define MAX_FILE_DOWNLOAD_RETRIES 3 +#define MAX_CRC_FAILED_DOWNLOAD_RETRIES 5 +#define MAX_FILE_DOWNLOAD_RETRIES 10 #define STATUS_DISABLED 0 #define STATUS_ENABLED 1 diff --git a/xpinstall/wizard/windows/setup/xpnetHook.cpp b/xpinstall/wizard/windows/setup/xpnetHook.cpp index caebdc3ed6b1..8c49a983739b 100644 --- a/xpinstall/wizard/windows/setup/xpnetHook.cpp +++ b/xpinstall/wizard/windows/setup/xpnetHook.cpp @@ -1166,11 +1166,18 @@ int DownloadFiles(char *szInputIniFile, PrintError(szBuf, ERROR_CODE_HIDE); } - /* Set return value and break out of for() loop. - * We don't want to continue if there were too - * many network errors on any file. */ - rv = WIZ_TOO_MANY_NETWORK_ERRORS; - break; + iFileDownloadRetries = 0; // reset the file download retries counter since + // we'll be restarting the download again. + bDownloadInitiated = FALSE; // restart the download using new socket connection + CloseSocket(szProxyServer, szProxyPort); + --giIndex; // Decrement the file index counter because we'll be trying to + // download the same file again. We don't want to go to the next + // file just yet. + + /* Let's make sure we're in a paused state. */ + /* The pause state will be unset by DownloadDlgProc(). */ + gdwDownloadDialogStatus = CS_PAUSE; + PauseTheDownload(rv, &iFileDownloadRetries); } else if(bIgnoreAllNetworkErrors || iIgnoreFileNetworkError) rv = nsFTPConn::OK;