зеркало из https://github.com/mozilla/gecko-dev.git
Backout 38cfb0413e04 (bug 767506) due to M1 permaorange.
This commit is contained in:
Родитель
2dcb0e79f3
Коммит
15b9e2b074
|
@ -75,7 +75,6 @@
|
|||
#include "nsIRedirectChannelRegistrar.h"
|
||||
#include "nsIMIMEHeaderParam.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
|
||||
|
@ -715,37 +714,6 @@ NS_NewProxyInfo(const nsACString &type,
|
|||
return rv;
|
||||
}
|
||||
|
||||
// returns 'true' if this is an HTTP proxy. If 'usingConnect' passed, sets it
|
||||
// to true if proxy is HTTP and is using CONNECT tunnel, else sets it to false
|
||||
inline bool
|
||||
NS_IsHttpProxy(nsIProxyInfo *proxyInfo, bool usingSSL, bool *usingConnect)
|
||||
{
|
||||
if (usingConnect)
|
||||
*usingConnect = false;
|
||||
if (!proxyInfo)
|
||||
return false;
|
||||
|
||||
nsCString proxyType;
|
||||
nsresult rv = proxyInfo->GetType(proxyType);
|
||||
if (NS_FAILED(rv))
|
||||
return false;
|
||||
|
||||
bool isHttp = !nsCRT::strcmp(proxyType.get(), "http");
|
||||
|
||||
// Only HTTP proxies use CONNECT
|
||||
if (isHttp && usingConnect) {
|
||||
*usingConnect = usingSSL; // SSL always uses CONNECT w/HTTP proxy
|
||||
if (!usingConnect) {
|
||||
PRUint32 resolveFlags = 0;
|
||||
if (NS_SUCCEEDED(proxyInfo->GetResolveFlags(&resolveFlags)) &&
|
||||
resolveFlags & nsIProtocolProxyService::RESOLVE_ALWAYS_TUNNEL) {
|
||||
*usingConnect = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isHttp;
|
||||
}
|
||||
|
||||
inline nsresult
|
||||
NS_GetFileProtocolHandler(nsIFileProtocolHandler **result,
|
||||
nsIIOService *ioService = nsnull)
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#define nsHttpConnectionInfo_h__
|
||||
|
||||
#include "nsHttp.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsProxyInfo.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDependentString.h"
|
||||
|
@ -33,11 +32,20 @@ public:
|
|||
{
|
||||
LOG(("Creating nsHttpConnectionInfo @%x\n", this));
|
||||
|
||||
mUsingHttpProxy = NS_IsHttpProxy(proxyInfo, usingSSL, &mUsingConnect);
|
||||
mUsingHttpProxy = (proxyInfo && !nsCRT::strcmp(proxyInfo->Type(), "http"));
|
||||
|
||||
if (mUsingHttpProxy) {
|
||||
mUsingConnect = mUsingSSL; // SSL always uses CONNECT
|
||||
PRUint32 resolveFlags = 0;
|
||||
if (NS_SUCCEEDED(mProxyInfo->GetResolveFlags(&resolveFlags)) &&
|
||||
resolveFlags & nsIProtocolProxyService::RESOLVE_ALWAYS_TUNNEL) {
|
||||
mUsingConnect = true;
|
||||
}
|
||||
}
|
||||
|
||||
SetOriginServer(host, port);
|
||||
}
|
||||
|
||||
|
||||
~nsHttpConnectionInfo()
|
||||
{
|
||||
LOG(("Destroying nsHttpConnectionInfo @%x\n", this));
|
||||
|
|
|
@ -1428,16 +1428,13 @@ nsHttpHandler::NewProxiedChannel(nsIURI *uri,
|
|||
httpChannel = new nsHttpChannel();
|
||||
}
|
||||
|
||||
// select proxy caps if using a non-transparent proxy. CONNECT tunneling
|
||||
// select proxy caps if using a non-transparent proxy. SSL tunneling
|
||||
// should not use proxy settings.
|
||||
PRInt8 caps;
|
||||
bool usingConnect;
|
||||
bool usingHttpProxy = NS_IsHttpProxy(proxyInfo, https, &usingConnect);
|
||||
if (usingHttpProxy && !usingConnect) {
|
||||
if (proxyInfo && !nsCRT::strcmp(proxyInfo->Type(), "http") && !https)
|
||||
caps = mProxyCapabilities;
|
||||
} else {
|
||||
else
|
||||
caps = mCapabilities;
|
||||
}
|
||||
|
||||
if (https) {
|
||||
// enable pipelining over SSL if requested
|
||||
|
|
Загрузка…
Ссылка в новой задаче