Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CDownloadTransferFTP Class Reference

#include <DownloadTransferFTP.h>

Inheritance diagram for CDownloadTransferFTP:

CDownloadTransfer CTransfer CConnection List of all members.

Public Member Functions

 CDownloadTransferFTP (CDownloadSource *pSource)
virtual ~CDownloadTransferFTP ()
virtual BOOL Initiate ()
virtual void Close (TRISTATE bKeepSource)
virtual void Boost ()
virtual DWORD GetAverageSpeed ()
virtual DWORD GetMeasuredSpeed ()
virtual BOOL SubtractRequested (FF::SimpleFragmentList &ppFragments)
virtual BOOL OnRun ()
virtual BOOL OnRead ()
virtual BOOL OnConnected ()
virtual void OnDropped (BOOL bError)
virtual BOOL OnHeaderLine (CString &strHeader, CString &strValue)

Protected Types

enum  FTP_STATES {
  ftpConnecting, ftpUSER, ftpPASS, ftpSIZE_TYPE,
  ftpSIZE, ftpLIST_TYPE, ftpLIST_PASVPORT, ftpLIST,
  ftpDownloading, ftpRETR_TYPE, ftpRETR_PASVPORT, ftpRETR_REST,
  ftpRETR, ftpABOR
}

Protected Member Functions

BOOL StartNextFragment ()
BOOL SendCommand (LPCTSTR args=NULL)

Protected Attributes

FTP_STATES m_FtpState
DWORD m_tRequest
CFTPLIST m_LIST
CFTPRETR m_RETR
BOOL m_bPassive
BOOL m_bSizeChecked

Classes

class  CFTPLIST
class  CFTPRETR

Member Enumeration Documentation

enum CDownloadTransferFTP::FTP_STATES [protected]
 

Enumeration values:
ftpConnecting 
ftpUSER 
ftpPASS 
ftpSIZE_TYPE 
ftpSIZE 
ftpLIST_TYPE 
ftpLIST_PASVPORT 
ftpLIST 
ftpDownloading 
ftpRETR_TYPE 
ftpRETR_PASVPORT 
ftpRETR_REST 
ftpRETR 
ftpABOR 

Definition at line 208 of file DownloadTransferFTP.h.


Constructor & Destructor Documentation

CDownloadTransferFTP::CDownloadTransferFTP CDownloadSource pSource  ) 
 

Definition at line 113 of file DownloadTransferFTP.cpp.

References m_RETR, and CDownloadTransferFTP::CFTPRETR::SetOwner().

virtual CDownloadTransferFTP::~CDownloadTransferFTP  )  [inline, virtual]
 

Definition at line 32 of file DownloadTransferFTP.h.


Member Function Documentation

void CDownloadTransferFTP::Boost  )  [virtual]
 

Reimplemented from CDownloadTransfer.

Definition at line 172 of file DownloadTransferFTP.cpp.

References m_LIST, CConnection::m_mInput, CConnection::m_mOutput, m_RETR, NULL, and TCPBandwidthMeter::pLimit.

void CDownloadTransferFTP::Close TRISTATE  bKeepSource  )  [virtual]
 

Reimplemented from CDownloadTransfer.

Definition at line 155 of file DownloadTransferFTP.cpp.

References CDownloadSource::AddFragment(), CTransfer::Close(), dtsDownloading, ftpConnecting, ftpRETR, m_bSizeChecked, m_FtpState, m_LIST, CDownloadTransfer::m_nOffset, CDownloadTransfer::m_nPosition, CDownloadTransfer::m_nState, CDownloadTransfer::m_pSource, m_RETR, and NULL.

DWORD CDownloadTransferFTP::GetAverageSpeed  )  [virtual]
 

Reimplemented from CDownloadTransfer.

Definition at line 179 of file DownloadTransferFTP.cpp.

References GetMeasuredSpeed(), CDownloadSource::m_nSpeed, and CDownloadTransfer::m_pSource.

DWORD CDownloadTransferFTP::GetMeasuredSpeed  )  [virtual]
 

Reimplemented from CDownloadTransfer.

Definition at line 184 of file DownloadTransferFTP.cpp.

References m_LIST, CConnection::m_mInput, m_RETR, CConnection::Measure(), and TCPBandwidthMeter::nMeasure.

Referenced by GetAverageSpeed().

BOOL CDownloadTransferFTP::Initiate  )  [virtual]
 

Implements CDownloadTransfer.

Definition at line 126 of file DownloadTransferFTP.cpp.

References CTransfer::Close(), CTransfer::ConnectTo(), Downloads, dtsConnecting, ftpConnecting, CDownloadWithFile::GetDisplayName(), IDS_DOWNLOAD_CONNECT_ERROR, IDS_DOWNLOAD_CONNECTING, CDownload::IsBoosted(), m_FtpState, CConnection::m_mInput, CConnection::m_mOutput, CDownloads::m_nLimitGeneric, CDownloadSource::m_nPort, CDownloadSource::m_pAddress, CDownloadTransfer::m_pDownload, CDownloadTransfer::m_pSource, CConnection::m_sAddress, CConnection::m_tConnected, CShareazaApp::Message(), MSG_DEFAULT, MSG_ERROR, TCPBandwidthMeter::pLimit, CDownloadTransfer::SetState(), theApp, and TS_UNKNOWN.

BOOL CDownloadTransferFTP::OnConnected  )  [virtual]
 

Reimplemented from CConnection.

Definition at line 195 of file DownloadTransferFTP.cpp.

References dtsRequesting, IDS_DOWNLOAD_CONNECTED, CConnection::m_sAddress, CConnection::m_tConnected, CShareazaApp::Message(), MSG_DEFAULT, CDownloadTransfer::SetState(), StartNextFragment(), and theApp.

void CDownloadTransferFTP::OnDropped BOOL  bError  )  [virtual]
 

Reimplemented from CConnection.

Definition at line 785 of file DownloadTransferFTP.cpp.

References CTransfer::Close(), dtsConnecting, dtsDownloading, IDS_DOWNLOAD_CONNECT_ERROR, IDS_DOWNLOAD_DROPPED, CDownloadTransfer::m_nState, CDownloadTransfer::m_pSource, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, NULL, CDownloadSource::PushRequest(), theApp, TS_TRUE, and TS_UNKNOWN.

BOOL CDownloadTransferFTP::OnHeaderLine CString &  strHeader,
CString &  strValue
[virtual]
 

Reimplemented from CTransfer.

Definition at line 364 of file DownloadTransferFTP.cpp.

References CTransfer::Close(), CDownloadTransferFTP::CFTPRETR::ConnectTo(), CDownloadTransferFTP::CFTPLIST::ConnectTo(), dtsDownloading, dtsRequesting, CDownloadTransferFTP::CFTPLIST::ExtractFileSize(), ftpABOR, ftpConnecting, ftpDownloading, FTPisOK(), ftpLIST, ftpLIST_PASVPORT, ftpLIST_TYPE, ftpPASS, ftpRETR, ftpRETR_PASVPORT, ftpRETR_REST, ftpRETR_TYPE, ftpSIZE, ftpSIZE_TYPE, ftpUSER, CDownloadWithFile::GetDisplayName(), IDS_DOWNLOAD_CONNECT_ERROR, IDS_DOWNLOAD_FILENOTFOUND, IDS_DOWNLOAD_HTTPCODE, IDS_DOWNLOAD_WRONG_SIZE, CConnection::IsAgentBlocked(), m_bPassive, m_bSizeChecked, m_FtpState, m_LIST, CDownloadBase::m_nSize, CDownloadTransfer::m_pDownload, CDownloadTransfer::m_pSource, m_RETR, CConnection::m_sAddress, CConnection::m_sUserAgent, CShareazaApp::Message(), MSG_DEBUG, MSG_ERROR, ParsePASVArgs(), SendCommand(), CDownloadSource::SetLastSeen(), CDownloadTransfer::SetState(), SIZE_UNKNOWN, StartNextFragment(), theApp, TS_FALSE, and TS_TRUE.

Referenced by OnRead().

BOOL CDownloadTransferFTP::OnRead  )  [virtual]
 

Reimplemented from CConnection.

Definition at line 340 of file DownloadTransferFTP.cpp.

References CConnection::m_pInput, CConnection::m_sLastHeader, OnHeaderLine(), CConnection::OnRead(), and CBuffer::ReadLine().

BOOL CDownloadTransferFTP::OnRun  )  [virtual]
 

Reimplemented from CDownloadTransfer.

Definition at line 277 of file DownloadTransferFTP.cpp.

References CTransfer::Close(), CSettings::Connection, CSettings::Downloads, dtsBusy, dtsConnecting, dtsDownloading, dtsFlushing, dtsHeaders, dtsMetadata, dtsQueued, dtsRequesting, dtsTiger, IDS_CONNECTION_TIMEOUT_CONNECT, IDS_DOWNLOAD_BUSY, IDS_DOWNLOAD_REQUEST_TIMEOUT, IDS_DOWNLOAD_TRAFFIC_TIMEOUT, CConnection::m_mInput, CDownloadTransfer::m_nState, CDownloadTransfer::m_pSource, CConnection::m_sAddress, CConnection::m_tConnected, m_tRequest, CShareazaApp::Message(), MSG_ERROR, NULL, CDownloadTransfer::OnRun(), CDownloadSource::PushRequest(), CSettings::sDownloads::RetryDelay, Settings, StartNextFragment(), theApp, CSettings::sConnection::TimeoutConnect, CSettings::sConnection::TimeoutHandshake, CSettings::sConnection::TimeoutTraffic, TCPBandwidthMeter::tLast, TS_TRUE, and TS_UNKNOWN.

BOOL CDownloadTransferFTP::SendCommand LPCTSTR  args = NULL  )  [protected]
 

Definition at line 668 of file DownloadTransferFTP.cpp.

References CBuffer::Clear(), ftpABOR, ftpLIST, ftpLIST_PASVPORT, ftpLIST_TYPE, ftpPASS, ftpRETR, ftpRETR_PASVPORT, ftpRETR_REST, ftpRETR_TYPE, ftpSIZE, ftpSIZE_TYPE, ftpUSER, m_bPassive, m_FtpState, CDownloadTransfer::m_nOffset, CConnection::m_pOutput, CDownloadTransfer::m_pSource, CConnection::m_sAddress, CSourceURL::m_sLogin, CSourceURL::m_sPassword, CSourceURL::m_sPath, CDownloadSource::m_sURL, m_tRequest, CShareazaApp::Message(), MSG_DEBUG, CSourceURL::ParseFTP(), CBuffer::Print(), and theApp.

Referenced by OnHeaderLine(), and StartNextFragment().

BOOL CDownloadTransferFTP::StartNextFragment  )  [protected]
 

Definition at line 208 of file DownloadTransferFTP.cpp.

References CTransfer::Close(), dtsDownloading, dtsRequesting, ftpConnecting, ftpRETR_TYPE, ftpSIZE_TYPE, CDownloadWithFile::GetDisplayName(), CDownloadWithFile::GetFragment(), IDS_DOWNLOAD_CLOSING_EXTRA, IDS_DOWNLOAD_FRAGMENT_END, IDS_DOWNLOAD_FRAGMENT_REQUEST, CDownloadTransfer::m_bRecvBackwards, m_bSizeChecked, CDownloadTransfer::m_bWantBackwards, m_FtpState, CDownloadTransfer::m_nLength, CDownloadTransfer::m_nOffset, CDownloadTransfer::m_nPosition, CDownloadBase::m_nSize, CDownloadTransfer::m_pDownload, CConnection::m_pInput, CConnection::m_pOutput, CDownloadTransfer::m_pSource, CConnection::m_sAddress, m_tRequest, CShareazaApp::Message(), MSG_DEFAULT, NULL, SendCommand(), CDownloadSource::SetAvailableRanges(), CDownloadTransfer::SetState(), SIZE_UNKNOWN, theApp, and TS_TRUE.

Referenced by OnConnected(), OnHeaderLine(), and OnRun().

BOOL CDownloadTransferFTP::SubtractRequested FF::SimpleFragmentList ppFragments  )  [virtual]
 

Implements CDownloadTransfer.

Definition at line 260 of file DownloadTransferFTP.cpp.

References dtsDownloading, dtsRequesting, detail::List< FragmentT, ContainerT >::erase(), CDownloadTransfer::m_nLength, CDownloadTransfer::m_nOffset, CDownloadTransfer::m_nState, and SIZE_UNKNOWN.


Member Data Documentation

BOOL CDownloadTransferFTP::m_bPassive [protected]
 

Definition at line 229 of file DownloadTransferFTP.h.

Referenced by OnHeaderLine(), and SendCommand().

BOOL CDownloadTransferFTP::m_bSizeChecked [protected]
 

Definition at line 230 of file DownloadTransferFTP.h.

Referenced by Close(), OnHeaderLine(), and StartNextFragment().

FTP_STATES CDownloadTransferFTP::m_FtpState [protected]
 

Definition at line 225 of file DownloadTransferFTP.h.

Referenced by Close(), Initiate(), OnHeaderLine(), SendCommand(), and StartNextFragment().

CFTPLIST CDownloadTransferFTP::m_LIST [protected]
 

Definition at line 227 of file DownloadTransferFTP.h.

Referenced by Boost(), Close(), GetMeasuredSpeed(), and OnHeaderLine().

CFTPRETR CDownloadTransferFTP::m_RETR [protected]
 

Definition at line 228 of file DownloadTransferFTP.h.

Referenced by Boost(), CDownloadTransferFTP(), Close(), GetMeasuredSpeed(), and OnHeaderLine().

DWORD CDownloadTransferFTP::m_tRequest [protected]
 

Definition at line 226 of file DownloadTransferFTP.h.

Referenced by OnRun(), SendCommand(), and StartNextFragment().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:06 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2