Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsFtpProtocolHandler.cpp File Reference
#include "nsFtpProtocolHandler.h"
#include "nsFTPChannel.h"
#include "nsIURL.h"
#include "nsIStandardURL.h"
#include "nsCRT.h"
#include "nsIComponentManager.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIProgressEventSink.h"
#include "prlog.h"
#include "nsNetUtil.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch2.h"
#include "nsIObserverService.h"
#include "nsEscape.h"

Go to the source code of this file.

Defines

#define LOG(args)   PR_LOG(gFTPLog, PR_LOG_DEBUG, args)
#define IDLE_TIMEOUT_PREF   "network.ftp.idleConnectionTimeout"
#define IDLE_CONNECTION_LIMIT   8 /* XXX pref me */

Functions

static NS_DEFINE_CID (kStandardURLCID, NS_STANDARDURL_CID)
static NS_DEFINE_CID (kCacheServiceCID, NS_CACHESERVICE_CID)
 NS_IMPL_THREADSAFE_ISUPPORTS4 (nsFtpProtocolHandler, nsIProtocolHandler, nsIProxiedProtocolHandler, nsIObserver, nsISupportsWeakReference) nsresult nsFtpProtocolHandler

Variables

nsFtpProtocolHandlergFtpHandler = nsnull

Define Documentation

#define IDLE_CONNECTION_LIMIT   8 /* XXX pref me */

Definition at line 89 of file nsFtpProtocolHandler.cpp.

#define IDLE_TIMEOUT_PREF   "network.ftp.idleConnectionTimeout"

Definition at line 88 of file nsFtpProtocolHandler.cpp.

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

Definition at line 84 of file nsFtpProtocolHandler.cpp.


Function Documentation

static NS_DEFINE_CID ( kStandardURLCID  ,
NS_STANDARDURL_CID   
) [static]
static NS_DEFINE_CID ( kCacheServiceCID  ,
NS_CACHESERVICE_CID   
) [static]

Definition at line 118 of file nsFtpProtocolHandler.cpp.

{
    nsresult rv;

    if (mIdleTimeout == -1) {
        nsCOMPtr<nsIPrefBranch2> branch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
        if (NS_FAILED(rv)) return rv;

        rv = branch->GetIntPref(IDLE_TIMEOUT_PREF, &mIdleTimeout);
        if (NS_FAILED(rv))
            mIdleTimeout = 5*60; // 5 minute default

        rv = branch->AddObserver(IDLE_TIMEOUT_PREF, this, PR_TRUE);
        if (NS_FAILED(rv)) return rv;
    }

    nsCOMPtr<nsIObserverService> observerService =
        do_GetService("@mozilla.org/observer-service;1");
    if (observerService)
        observerService->AddObserver(this,
                                     "network:offline-about-to-go-offline",
                                     PR_FALSE);
    
    return NS_OK;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 94 of file nsFtpProtocolHandler.cpp.