Bug 1288308 - Part 0: add Named Pipe type on Windows platform; r=bagder

MozReview-Commit-ID: It2l5BJuHiS
This commit is contained in:
Liang-Heng Chen
2016-09-01 15:48:39 +08:00
parent ecf14cde42
commit 7b19c19155
8 changed files with 55 additions and 31 deletions

View File

@@ -22,6 +22,7 @@
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsThreadUtils.h"
#include "nsSOCKSIOLayer.h"
#include "nsString.h"
#include "nsNetUtil.h"
#include "nsNetCID.h"
@@ -387,16 +388,6 @@ proxy_GetBoolPref(nsIPrefBranch *aPrefBranch,
aResult = temp;
}
static inline bool
IsHostDomainSocket(const nsACString& aHost)
{
#ifdef XP_UNIX
return Substring(aHost, 0, 5) == "file:";
#else
return false;
#endif // XP_UNIX
}
//----------------------------------------------------------------------------
static const int32_t PROXYCONFIG_DIRECT4X = 3;
@@ -1862,7 +1853,7 @@ nsProtocolProxyService::Resolve_Internal(nsIChannel *channel,
if ((flags & RESOLVE_PREFER_SOCKS_PROXY) &&
!mSOCKSProxyTarget.IsEmpty() &&
(IsHostDomainSocket(mSOCKSProxyTarget) || mSOCKSProxyPort > 0)) {
(IsHostLocalTarget(mSOCKSProxyTarget) || mSOCKSProxyPort > 0)) {
host = &mSOCKSProxyTarget;
if (mSOCKSProxyVersion == 4)
type = kProxyType_SOCKS4;
@@ -1900,7 +1891,7 @@ nsProtocolProxyService::Resolve_Internal(nsIChannel *channel,
port = mFTPProxyPort;
}
else if (!mSOCKSProxyTarget.IsEmpty() &&
(IsHostDomainSocket(mSOCKSProxyTarget) || mSOCKSProxyPort > 0)) {
(IsHostLocalTarget(mSOCKSProxyTarget) || mSOCKSProxyPort > 0)) {
host = &mSOCKSProxyTarget;
if (mSOCKSProxyVersion == 4)
type = kProxyType_SOCKS4;