Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsFtpConnectionThread.cpp File Reference
#include "nsFTPChannel.h"
#include "nsFtpConnectionThread.h"
#include "nsFtpControlConnection.h"
#include "nsFtpProtocolHandler.h"
#include <limits.h>
#include <ctype.h>
#include "nsISocketTransport.h"
#include "nsIStreamConverterService.h"
#include "nsIStreamListenerTee.h"
#include "nsReadableUtils.h"
#include "prprf.h"
#include "prlog.h"
#include "prtime.h"
#include "prnetdb.h"
#include "netCore.h"
#include "ftpCore.h"
#include "nsProxiedService.h"
#include "nsCRT.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIURL.h"
#include "nsEscape.h"
#include "nsNetUtil.h"
#include "nsIDNSService.h"
#include "nsCPasswordManager.h"
#include "nsIMemory.h"
#include "nsIStringStream.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsMimeTypes.h"
#include "nsIStringBundle.h"
#include "nsEventQueueUtils.h"
#include "nsChannelProperties.h"
#include "nsICacheEntryDescriptor.h"
#include "nsICacheListener.h"
#include "nsIResumableChannel.h"

Go to the source code of this file.

Classes

class  TransportEventForwarder
 This object observes status from a control connection. More...
class  DataRequestForwarder
 This object observes events for a data connection. More...

Defines

#define LOG(args)
#define LOG_ALWAYS(args)
#define NowInSeconds()   PRTimeToSeconds(PR_Now())

Functions

static NS_DEFINE_CID (kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID)
static NS_DEFINE_CID (kStreamListenerTeeCID, NS_STREAMLISTENERTEE_CID)
static NS_DEFINE_CID (kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID)
 NS_IMPL_THREADSAFE_ISUPPORTS7 (DataRequestForwarder, nsIStreamListener, nsIRequestObserver, nsIFTPChannel, nsIResumableChannel, nsIChannel, nsIRequest, nsITransportEventSink) DataRequestForwarder
 NS_IMPL_THREADSAFE_ISUPPORTS3 (nsFtpState, nsIStreamListener, nsIRequestObserver, nsIRequest) nsFtpState
static PRUint32 PRTimeToSeconds (PRTime t_usec)

Define Documentation

#define LOG (   args)

Definition at line 91 of file nsFtpConnectionThread.cpp.

Definition at line 92 of file nsFtpConnectionThread.cpp.

Definition at line 2098 of file nsFtpConnectionThread.cpp.


Function Documentation

static NS_DEFINE_CID ( kStreamConverterServiceCID  ,
NS_STREAMCONVERTERSERVICE_CID   
) [static]
static NS_DEFINE_CID ( kStreamListenerTeeCID  ,
NS_STREAMLISTENERTEE_CID   
) [static]
static NS_DEFINE_CID ( kSocketTransportServiceCID  ,
NS_SOCKETTRANSPORTSERVICE_CID   
) [static]

Definition at line 403 of file nsFtpConnectionThread.cpp.

{
    LOG_ALWAYS(("(%x) nsFtpState created", this));

    // bool init
    mRETRFailed = PR_FALSE;
    mWaitingForDConn = mTryingCachedControl = mRetryPass = PR_FALSE;
    mKeepRunning = mAnonymous = PR_TRUE;

    mAction = GET;
    mState = FTP_COMMAND_CONNECT;
    mNextState = FTP_S_USER;

    mInternalError = NS_OK;
    mSuspendCount = 0;
    mPort = 21;

    mReceivedControlData = PR_FALSE;
    mControlStatus = NS_OK;

    mWriteCount = 0;

    mAddressChecked = PR_FALSE;
    mServerIsIPv6 = PR_FALSE;
    
    mControlConnection = nsnull;
    mDRequestForwarder = nsnull;
    mFileSize          = LL_MAXUINT;

    // make sure handler stays around
    NS_ADDREF(gFtpHandler);
}

Here is the call graph for this function:

Definition at line 189 of file nsFtpConnectionThread.cpp.

{
    LOG(("(%x) DataRequestForwarder CREATED\n", this));

    mBytesTransfered = 0;
    mBytesToUpload = 0;
    mRetrying = mUploading = mDelayedOnStartFired = PR_FALSE;
    mFileSize = LL_MAXUINT;
}
static PRUint32 PRTimeToSeconds ( PRTime  t_usec) [inline, static]

Definition at line 2088 of file nsFtpConnectionThread.cpp.

{
    PRTime usec_per_sec;
    PRUint32 t_sec;
    LL_I2L(usec_per_sec, PR_USEC_PER_SEC);
    LL_DIV(t_usec, t_usec, usec_per_sec);
    LL_L2I(t_sec, t_usec);
    return t_sec;
}