fixing bug 73870 - Proxy saves http proxy information as ftp preferences. r=dveditz, sr=mscott. affects only windows platforms/builds
git-svn-id: svn://10.0.0.236/trunk@94622 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
0c636c2375
commit
12f73b9b53
@ -6565,11 +6565,19 @@ void DeInitialize()
|
||||
sgProduct.szProductName,
|
||||
MB_OKCANCEL | MB_ICONQUESTION) == IDOK)
|
||||
// PrintError(szMsg, ERROR_CODE_HIDE);
|
||||
WGet(szFullURL);
|
||||
WGet(szFullURL,
|
||||
diAdvancedSettings.szProxyServer,
|
||||
diAdvancedSettings.szProxyPort,
|
||||
diAdvancedSettings.szProxyUser,
|
||||
diAdvancedSettings.szProxyPasswd);
|
||||
}
|
||||
else if(!gErrorMessageStream.bShowConfirmation)
|
||||
//PrintError(szMsg, ERROR_CODE_HIDE);
|
||||
WGet(szFullURL);
|
||||
WGet(szFullURL,
|
||||
diAdvancedSettings.szProxyServer,
|
||||
diAdvancedSettings.szProxyPort,
|
||||
diAdvancedSettings.szProxyUser,
|
||||
diAdvancedSettings.szProxyPasswd);
|
||||
|
||||
FreeMemory(&szFullURL);
|
||||
}
|
||||
|
||||
@ -986,17 +986,28 @@ void UpdateJSProxyInfo()
|
||||
ZeroMemory(szBuf, sizeof(szBuf));
|
||||
if(*diAdvancedSettings.szProxyServer != '\0')
|
||||
{
|
||||
lstrcpy(szBuf, "user_pref(\"network.proxy.ftp\", \"");
|
||||
lstrcat(szBuf, diAdvancedSettings.szProxyServer);
|
||||
lstrcat(szBuf, "\");\n");
|
||||
if(diDownloadOptions.dwUseProtocol == UP_FTP)
|
||||
wsprintf(szBuf,
|
||||
"user_pref(\"network.proxy.ftp\", \"%s\");\n",
|
||||
diAdvancedSettings.szProxyServer);
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
"user_pref(\"network.proxy.http\", \"%s\");\n",
|
||||
diAdvancedSettings.szProxyServer);
|
||||
}
|
||||
|
||||
if(*diAdvancedSettings.szProxyPort != '\0')
|
||||
{
|
||||
lstrcat(szBuf, "user_pref(\"network.proxy.ftp_port\", ");
|
||||
lstrcat(szBuf, diAdvancedSettings.szProxyPort);
|
||||
lstrcat(szBuf, ");\n");
|
||||
if(diDownloadOptions.dwUseProtocol == UP_FTP)
|
||||
wsprintf(szBuf,
|
||||
"user_pref(\"network.proxy.ftp_port\", %s);\n",
|
||||
diAdvancedSettings.szProxyPort);
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
"user_pref(\"network.proxy.http_port\", %s);\n",
|
||||
diAdvancedSettings.szProxyPort);
|
||||
}
|
||||
|
||||
lstrcat(szBuf, "user_pref(\"network.proxy.type\", 1);\n");
|
||||
|
||||
fwrite(szBuf, sizeof(char), lstrlen(szBuf), fJSFile);
|
||||
|
||||
@ -446,13 +446,41 @@ void GetTotalArchivesToDownload(int *iTotalArchivesToDownload, DWORD *dwTotalEst
|
||||
}
|
||||
|
||||
/* Function used only to send the message stream error */
|
||||
int WGet(char *szUrl)
|
||||
int WGet(char *szUrl,
|
||||
char *szProxyServer,
|
||||
char *szProxyPort,
|
||||
char *szProxyUser,
|
||||
char *szProxyPasswd)
|
||||
{
|
||||
int rv;
|
||||
int rv;
|
||||
char proxyURL[MAX_BUF];
|
||||
nsHTTPConn *conn = NULL;
|
||||
|
||||
nsHTTPConn *conn = new nsHTTPConn(szUrl);
|
||||
if(conn == NULL)
|
||||
return(WIZ_OUT_OF_MEMORY);
|
||||
if((szProxyServer != NULL) && (szProxyPort != NULL) &&
|
||||
(*szProxyServer != '\0') && (*szProxyPort != '\0'))
|
||||
{
|
||||
/* detected proxy information, let's use it */
|
||||
memset(proxyURL, 0, sizeof(proxyURL));
|
||||
wsprintf(proxyURL, "http://%s:%s", szProxyServer, szProxyPort);
|
||||
|
||||
conn = new nsHTTPConn(proxyURL);
|
||||
if(conn == NULL)
|
||||
return(WIZ_OUT_OF_MEMORY);
|
||||
|
||||
if((szProxyUser != NULL) && (*szProxyUser != '\0') &&
|
||||
(szProxyPasswd != NULL) && (*szProxyPasswd != '\0'))
|
||||
/* detected user and password info */
|
||||
conn->SetProxyInfo(szUrl, szProxyUser, szProxyPasswd);
|
||||
else
|
||||
conn->SetProxyInfo(szUrl, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no proxy information supplied. set up normal http object */
|
||||
conn = new nsHTTPConn(szUrl);
|
||||
if(conn == NULL)
|
||||
return(WIZ_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
rv = conn->Open();
|
||||
if(rv == WIZ_OK)
|
||||
|
||||
@ -23,7 +23,11 @@
|
||||
#ifndef _XPNETHOOK_H_
|
||||
#define _XPNETHOOK_H_
|
||||
|
||||
int WGet(char *szUrl);
|
||||
int WGet(char *szUrl,
|
||||
char *szProxyServer,
|
||||
char *szProxyPort,
|
||||
char *szProxyUser,
|
||||
char *szProxyPasswd);
|
||||
int DownloadFiles(char *szInputIniFile,
|
||||
char *szDownloadDir,
|
||||
char *szProxyServer,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user