Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsProtocolProxyService.cpp File Reference
#include "nsProtocolProxyService.h"
#include "nsProxyInfo.h"
#include "nsIServiceManager.h"
#include "nsXPIDLString.h"
#include "nsIProxyAutoConfig.h"
#include "nsAutoLock.h"
#include "nsEventQueueUtils.h"
#include "nsIIOService.h"
#include "nsIObserverService.h"
#include "nsIProtocolHandler.h"
#include "nsIProtocolProxyCallback.h"
#include "nsICancelable.h"
#include "nsIDNSService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch2.h"
#include "nsReadableUtils.h"
#include "nsString.h"
#include "nsNetUtil.h"
#include "nsCRT.h"
#include "prnetdb.h"
#include "nsPACMan.h"
#include "prlog.h"

Go to the source code of this file.

Classes

struct  nsProtocolInfo
class  nsAsyncResolveRequest

Defines

#define LOG(args)   PR_LOG(sLog, PR_LOG_DEBUG, args)
#define IS_ASCII_SPACE(_c)   ((_c) == ' ' || (_c) == '\t')

Functions

static void proxy_MaskIPv6Addr (PRIPv6Addr &addr, PRUint16 mask_len)
static void proxy_GetStringPref (nsIPrefBranch *aPrefBranch, const char *aPref, nsCString &aResult)
static void proxy_GetIntPref (nsIPrefBranch *aPrefBranch, const char *aPref, PRInt32 &aResult)
static void proxy_GetBoolPref (nsIPrefBranch *aPrefBranch, const char *aPref, PRBool &aResult)
 NS_IMPL_ISUPPORTS3 (nsProtocolProxyService, nsIProtocolProxyService, nsPIProtocolProxyService, nsIObserver) nsProtocolProxyService

Variables

static const char kProxyType_HTTP [] = "http"
static const char kProxyType_PROXY [] = "proxy"
static const char kProxyType_SOCKS [] = "socks"
static const char kProxyType_SOCKS4 [] = "socks4"
static const char kProxyType_SOCKS5 [] = "socks5"
static const char kProxyType_DIRECT [] = "direct"
static const char kProxyType_UNKNOWN [] = "unknown"

Class Documentation

struct nsProtocolInfo

Definition at line 74 of file nsProtocolProxyService.cpp.

Collaboration diagram for nsProtocolInfo:
Class Members
PRInt32 defaultPort
PRUint32 flags
nsCAutoString scheme

Define Documentation

#define IS_ASCII_SPACE (   _c)    ((_c) == ' ' || (_c) == '\t')

Definition at line 219 of file nsProtocolProxyService.cpp.

#define LOG (   args)    PR_LOG(sLog, PR_LOG_DEBUG, args)

Definition at line 69 of file nsProtocolProxyService.cpp.


Function Documentation

Definition at line 301 of file nsProtocolProxyService.cpp.

    : mFilters(nsnull)
    , mProxyConfig(eProxyConfig_Direct)
    , mHTTPProxyPort(-1)
    , mFTPProxyPort(-1)
    , mGopherProxyPort(-1)
    , mHTTPSProxyPort(-1)
    , mSOCKSProxyPort(-1)
    , mSOCKSProxyVersion(4)
    , mSOCKSProxyRemoteDNS(PR_FALSE)
    , mPACMan(nsnull)
    , mSessionStart(PR_Now())
    , mFailedProxyTimeout(30 * 60) // 30 minute default
{
}
static void proxy_GetBoolPref ( nsIPrefBranch aPrefBranch,
const char *  aPref,
PRBool aResult 
) [static]

Definition at line 287 of file nsProtocolProxyService.cpp.

{
    PRBool temp;
    nsresult rv = aPrefBranch->GetBoolPref(aPref, &temp);
    if (NS_FAILED(rv)) 
        aResult = PR_FALSE;
    else
        aResult = temp;
}
static void proxy_GetIntPref ( nsIPrefBranch aPrefBranch,
const char *  aPref,
PRInt32 aResult 
) [static]

Definition at line 274 of file nsProtocolProxyService.cpp.

{
    PRInt32 temp;
    nsresult rv = aPrefBranch->GetIntPref(aPref, &temp);
    if (NS_FAILED(rv)) 
        aResult = -1;
    else
        aResult = temp;
}
static void proxy_GetStringPref ( nsIPrefBranch aPrefBranch,
const char *  aPref,
nsCString aResult 
) [static]

Definition at line 257 of file nsProtocolProxyService.cpp.

{
    nsXPIDLCString temp;
    nsresult rv = aPrefBranch->GetCharPref(aPref, getter_Copies(temp));
    if (NS_FAILED(rv))
        aResult.Truncate();
    else {
        aResult.Assign(temp);
        // all of our string prefs are hostnames, so we should remove any
        // whitespace characters that the user might have unknowingly entered.
        aResult.StripWhitespace();
    }
}

Here is the call graph for this function:

static void proxy_MaskIPv6Addr ( PRIPv6Addr addr,
PRUint16  mask_len 
) [static]

Definition at line 227 of file nsProtocolProxyService.cpp.

{
    if (mask_len == 128)
        return;

    if (mask_len > 96) {
        addr.pr_s6_addr32[3] = PR_htonl(
                PR_ntohl(addr.pr_s6_addr32[3]) & (~0L << (128 - mask_len)));
    }
    else if (mask_len > 64) {
        addr.pr_s6_addr32[3] = 0;
        addr.pr_s6_addr32[2] = PR_htonl(
                PR_ntohl(addr.pr_s6_addr32[2]) & (~0L << (96 - mask_len)));
    }
    else if (mask_len > 32) {
        addr.pr_s6_addr32[3] = 0;
        addr.pr_s6_addr32[2] = 0;
        addr.pr_s6_addr32[1] = PR_htonl(
                PR_ntohl(addr.pr_s6_addr32[1]) & (~0L << (64 - mask_len)));
    }
    else {
        addr.pr_s6_addr32[3] = 0;
        addr.pr_s6_addr32[2] = 0;
        addr.pr_s6_addr32[1] = 0;
        addr.pr_s6_addr32[0] = PR_htonl(
                PR_ntohl(addr.pr_s6_addr32[0]) & (~0L << (32 - mask_len)));
    }
}

Variable Documentation

const char kProxyType_DIRECT[] = "direct" [static]

Definition at line 579 of file nsProtocolProxyService.cpp.

const char kProxyType_HTTP[] = "http" [static]

Definition at line 574 of file nsProtocolProxyService.cpp.

const char kProxyType_PROXY[] = "proxy" [static]

Definition at line 575 of file nsProtocolProxyService.cpp.

const char kProxyType_SOCKS[] = "socks" [static]

Definition at line 576 of file nsProtocolProxyService.cpp.

const char kProxyType_SOCKS4[] = "socks4" [static]

Definition at line 577 of file nsProtocolProxyService.cpp.

const char kProxyType_SOCKS5[] = "socks5" [static]

Definition at line 578 of file nsProtocolProxyService.cpp.

const char kProxyType_UNKNOWN[] = "unknown" [static]

Definition at line 580 of file nsProtocolProxyService.cpp.