fixing bug 82279 - Win32 Installer crashes when using ftp proxy. r=sgehani,sr=mscott,a=chofmann. affects windows only
git-svn-id: svn://10.0.0.236/trunk@95776 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
abadb6c4b1
commit
a354fe84f3
@ -520,12 +520,12 @@ int DownloadViaProxy(char *szUrl, char *szProxyServer, char *szProxyPort, char *
|
||||
{
|
||||
int rv;
|
||||
char proxyURL[kProxySrvrLen];
|
||||
char *host = NULL;
|
||||
char *path = NULL;
|
||||
char *file = NULL;
|
||||
int port;
|
||||
|
||||
rv = nsHTTPConn::ParseURL(kHTTP, szUrl, &host, &port, &path);
|
||||
if((!szUrl) || (*szUrl == '\0'))
|
||||
return nsHTTPConn::E_PARAM;
|
||||
|
||||
rv = nsHTTPConn::OK;
|
||||
memset(proxyURL, 0, kProxySrvrLen);
|
||||
wsprintf(proxyURL, "http://%s:%s", szProxyServer, szProxyPort);
|
||||
|
||||
@ -549,8 +549,8 @@ int DownloadViaProxy(char *szUrl, char *szProxyServer, char *szProxyPort, char *
|
||||
if((rv = conn->Open()) != WIZ_OK)
|
||||
return(rv);
|
||||
|
||||
if(strrchr(path, '/') != (path + strlen(path)))
|
||||
file = strrchr(path, '/') + 1; // set to leaf name
|
||||
if(strrchr(szUrl, '/') != (szUrl + strlen(szUrl)))
|
||||
file = strrchr(szUrl, '/') + 1; // set to leaf name
|
||||
|
||||
rv = conn->Get(ProgressCB, file); // use leaf from URL
|
||||
conn->Close();
|
||||
@ -564,12 +564,12 @@ int DownloadViaProxy(char *szUrl, char *szProxyServer, char *szProxyPort, char *
|
||||
int DownloadViaHTTP(char *szUrl)
|
||||
{
|
||||
int rv;
|
||||
char *host = NULL;
|
||||
char *path = NULL;
|
||||
char *file = NULL;
|
||||
int port;
|
||||
|
||||
rv = nsHTTPConn::ParseURL(kHTTP, szUrl, &host, &port, &path);
|
||||
if((!szUrl) || (*szUrl == '\0'))
|
||||
return nsHTTPConn::E_PARAM;
|
||||
|
||||
rv = nsHTTPConn::OK;
|
||||
nsHTTPConn *conn = new nsHTTPConn(szUrl, ProcessWndMsgCB);
|
||||
if(conn == NULL)
|
||||
{
|
||||
@ -584,8 +584,8 @@ int DownloadViaHTTP(char *szUrl)
|
||||
if((rv = conn->Open()) != WIZ_OK)
|
||||
return(rv);
|
||||
|
||||
if(strrchr(path, '/') != (path + strlen(path)))
|
||||
file = strrchr(path, '/') + 1; // set to leaf name
|
||||
if(strrchr(szUrl, '/') != (szUrl + strlen(szUrl)))
|
||||
file = strrchr(szUrl, '/') + 1; // set to leaf name
|
||||
|
||||
rv = conn->Get(ProgressCB, file);
|
||||
conn->Close();
|
||||
@ -602,6 +602,9 @@ int DownloadViaFTP(char *szUrl)
|
||||
int port = 21;
|
||||
int rv;
|
||||
|
||||
if((!szUrl) || (*szUrl == '\0'))
|
||||
return nsFTPConn::E_PARAM;
|
||||
|
||||
rv = nsHTTPConn::ParseURL(kFTP, szUrl, &host, &port, &path);
|
||||
|
||||
nsFTPConn *conn = new nsFTPConn(host, ProcessWndMsgCB);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user