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

CDownloadTransfer Class Reference

#include <DownloadTransfer.h>

Inheritance diagram for CDownloadTransfer:

CTransfer CConnection CDownloadTransferBT CDownloadTransferED2K CDownloadTransferFTP CDownloadTransferHTTP List of all members.

Public Member Functions

 CDownloadTransfer (CDownloadSource *pSource, PROTOCOLID nProtocol)
virtual ~CDownloadTransfer ()
virtual BOOL Initiate ()=0
virtual void Close (TRISTATE bKeepSource)
virtual void Boost ()
virtual DWORD GetAverageSpeed ()
virtual DWORD GetMeasuredSpeed ()
virtual BOOL SubtractRequested (FF::SimpleFragmentList &ppFragments)=0
virtual BOOL UnrequestRange (QWORD nOffset, QWORD nLength)
virtual CString GetStateText (BOOL bLong)
virtual BOOL OnRun ()
void SetState (int nState)

Public Attributes

PROTOCOLID m_nProtocol
CDownloadm_pDownload
CDownloadTransferm_pDlPrev
CDownloadTransferm_pDlNext
CDownloadSourcem_pSource
int m_nState
int m_nQueuePos
int m_nQueueLen
CString m_sQueueName
QWORD m_nOffset
QWORD m_nLength
QWORD m_nPosition
QWORD m_nDownloaded
BOOL m_bWantBackwards
BOOL m_bRecvBackwards

Protected Member Functions

void ChunkifyRequest (QWORD *pnOffset, QWORD *pnLength, QWORD nChunk, BOOL bVerifyLock)

Constructor & Destructor Documentation

CDownloadTransfer::CDownloadTransfer CDownloadSource pSource,
PROTOCOLID  nProtocol
 

Definition at line 48 of file DownloadTransfer.cpp.

References CDownloadWithTransfers::AddTransfer(), dtsNull, m_bRecvBackwards, m_bWantBackwards, m_nDownloaded, m_nLength, m_nOffset, m_nPosition, m_nProtocol, m_nQueueLen, m_nQueuePos, m_nState, m_pDlNext, m_pDlPrev, CDownloadSource::m_pDownload, m_pDownload, m_pSource, NULL, and SIZE_UNKNOWN.

CDownloadTransfer::~CDownloadTransfer  )  [virtual]
 

Definition at line 71 of file DownloadTransfer.cpp.

References m_pSource, and NULL.


Member Function Documentation

void CDownloadTransfer::Boost  )  [virtual]
 

Reimplemented in CDownloadTransferBT, CDownloadTransferED2K, CDownloadTransferFTP, and CDownloadTransferHTTP.

Definition at line 110 of file DownloadTransfer.cpp.

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

void CDownloadTransfer::ChunkifyRequest QWORD pnOffset,
QWORD pnLength,
QWORD  nChunk,
BOOL  bVerifyLock
[protected]
 

Definition at line 267 of file DownloadTransfer.cpp.

References CSettings::sDownloads::ChunkSize, CSettings::sDownloads::ChunkStrap, CSettings::Downloads, CDownloadWithTiger::GetVerifyLength(), CDownloadWithFile::GetVolumeComplete(), CDownloadSource::m_bCloseConn, m_bWantBackwards, m_nDownloaded, m_pDownload, m_pSource, NULL, and Settings.

Referenced by CDownloadTransferED2K::SendFragmentRequests(), CDownloadTransferBT::SendRequests(), and CDownloadTransferHTTP::StartNextFragment().

void CDownloadTransfer::Close TRISTATE  bKeepSource  )  [virtual]
 

Reimplemented in CDownloadTransferBT, CDownloadTransferED2K, CDownloadTransferFTP, and CDownloadTransferHTTP.

Definition at line 79 of file DownloadTransfer.cpp.

References CTransfer::Close(), dtsNull, m_pDownload, m_pSource, NULL, CDownloadSource::OnFailure(), CDownloadSource::Remove(), CDownloadWithTransfers::RemoveTransfer(), SetState(), TS_FALSE, TS_TRUE, and TS_UNKNOWN.

Referenced by CDownloadWithTransfers::OnAcceptPush(), CDownloadWithTransfers::OnDonkeyCallback(), and CDownloadSource::Remove().

DWORD CDownloadTransfer::GetAverageSpeed  )  [virtual]
 

Reimplemented in CDownloadTransferBT, CDownloadTransferED2K, CDownloadTransferFTP, and CDownloadTransferHTTP.

Definition at line 115 of file DownloadTransfer.cpp.

References GetMeasuredSpeed().

Referenced by CDownloadWithFile::GetFragment(), and CDownloadWithFile::IsRangeUsefulEnough().

DWORD CDownloadTransfer::GetMeasuredSpeed  )  [virtual]
 

Reimplemented in CDownloadTransferBT, CDownloadTransferED2K, and CDownloadTransferFTP.

Definition at line 120 of file DownloadTransfer.cpp.

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

Referenced by GetAverageSpeed(), CDownloadTipCtrl::OnPaint(), CDownloadTipCtrl::OnTimer(), and CDownloadsCtrl::PaintSource().

CString CDownloadTransfer::GetStateText BOOL  bLong  )  [virtual]
 

Reimplemented in CDownloadTransferBT.

Definition at line 129 of file DownloadTransfer.cpp.

References dtsBusy, dtsConnecting, dtsDownloading, dtsEnqueue, dtsFlushing, dtsHashset, dtsHeaders, dtsMetadata, dtsQueued, dtsRequesting, dtsTiger, IDS_GENERAL_OF, IDS_STATUS_BUSY, IDS_STATUS_CONNECTING, IDS_STATUS_DOWNLOADING, IDS_STATUS_ENQUEUE, IDS_STATUS_HASHSET, IDS_STATUS_METADATA, IDS_STATUS_Q, IDS_STATUS_QUEUED, IDS_STATUS_REQUESTING, IDS_STATUS_RESPONSE, IDS_STATUS_TIGERTREE, IDS_STATUS_UNKNOWN, LoadString(), m_nQueueLen, m_nQueuePos, m_nState, and m_sQueueName.

Referenced by CDownloadTransferBT::GetStateText(), CDownloadTipCtrl::OnPaint(), and CDownloadsCtrl::PaintSource().

virtual BOOL CDownloadTransfer::Initiate  )  [pure virtual]
 

Implemented in CDownloadTransferBT, CDownloadTransferED2K, CDownloadTransferFTP, and CDownloadTransferHTTP.

Referenced by CDownloadWithTransfers::StartNewTransfer().

BOOL CDownloadTransfer::OnRun  )  [virtual]
 

Reimplemented from CConnection.

Reimplemented in CDownloadTransferBT, CDownloadTransferED2K, CDownloadTransferFTP, and CDownloadTransferHTTP.

Definition at line 194 of file DownloadTransfer.cpp.

References CConnection::OnRun().

Referenced by CDownloadTransferHTTP::OnRun(), CDownloadTransferFTP::OnRun(), and CDownloadTransferBT::OnRun().

void CDownloadTransfer::SetState int  nState  ) 
 

Definition at line 202 of file DownloadTransfer.cpp.

References CSettings::Downloads, dtsDownloading, dtsQueued, dtsTorrent, CDownloadTransferBT::m_bChoked, CDownloadTransferBT::m_bInterested, m_nProtocol, m_nQueuePos, CDownloadSource::m_nSortOrder, m_nState, CDownloadSource::m_pAddress, m_pDownload, m_pSource, CDownloadSource::m_pTransfer, NULL, PROTOCOL_HTTP, Settings, CDownloadWithSources::SortSource(), and CSettings::sDownloads::SortSources.

Referenced by CEDClient::Close(), CDownloadTransferED2K::Close(), Close(), CDownloadTransferHTTP::Initiate(), CDownloadTransferFTP::Initiate(), CDownloadTransferED2K::Initiate(), CDownloadTransferBT::Initiate(), CDownloadTransferBT::OnChoked(), CDownloadTransferFTP::OnConnected(), CDownloadTransferBT::OnConnected(), CDownloadSource::OnFailure(), CDownloadTransferFTP::OnHeaderLine(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferBT::OnPiece(), CDownloadTransferED2K::OnStartUpload(), CDownloadTransferBT::OnUnchoked(), CDownloadTransferHTTP::ReadFlush(), CDownloadTransferHTTP::ReadResponseLine(), CDownloadTransferED2K::SendPrimaryRequest(), CDownloadTransferHTTP::SendRequest(), CDownloadTransferBT::SendRequests(), CDownloadTransferED2K::SendSecondaryRequest(), CDownloadTransferED2K::SetQueueRank(), and CDownloadTransferFTP::StartNextFragment().

virtual BOOL CDownloadTransfer::SubtractRequested FF::SimpleFragmentList ppFragments  )  [pure virtual]
 

Implemented in CDownloadTransferBT, CDownloadTransferED2K, CDownloadTransferFTP, and CDownloadTransferHTTP.

virtual BOOL CDownloadTransfer::UnrequestRange QWORD  nOffset,
QWORD  nLength
[inline, virtual]
 

Reimplemented in CDownloadTransferBT.

Definition at line 69 of file DownloadTransfer.h.


Member Data Documentation

BOOL CDownloadTransfer::m_bRecvBackwards
 

Definition at line 59 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), CDownloadTransferHTTP::Close(), CFragmentBar::DrawSourceImpl(), CDownloadWithFile::GetFragment(), CDownloadWithFile::IsRangeUsefulEnough(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferHTTP::ReadContent(), CDownloadTransferHTTP::StartNextFragment(), and CDownloadTransferFTP::StartNextFragment().

BOOL CDownloadTransfer::m_bWantBackwards
 

Definition at line 58 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), ChunkifyRequest(), CDownloadTransferHTTP::SendRequest(), CDownloadTransferHTTP::StartNextFragment(), and CDownloadTransferFTP::StartNextFragment().

QWORD CDownloadTransfer::m_nDownloaded
 

Definition at line 56 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), ChunkifyRequest(), CDownloadTransferED2K::OnCompressedPart(), CDownloadTransferBT::OnPiece(), CDownloadTransferFTP::CFTPRETR::OnRead(), CDownloadTransferED2K::OnSendingPart(), CDownloadsCtrl::PaintSource(), CDownloadTransferHTTP::ReadContent(), CDownloadTransferED2K::SendFragmentRequests(), and CDownloadTransferBT::SendRequests().

QWORD CDownloadTransfer::m_nLength
 

Definition at line 54 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), CDownloadTransferHTTP::Close(), CFragmentBar::DrawSource(), CFragmentBar::DrawSourceImpl(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferFTP::CFTPRETR::OnRead(), CDownloadTransferHTTP::ReadContent(), CDownloadTransferHTTP::ReadMetadata(), CDownloadTransferHTTP::ReadTiger(), CDownloadTransferHTTP::SendRequest(), CDownloadTransferHTTP::StartNextFragment(), CDownloadTransferFTP::StartNextFragment(), CDownloadTransferHTTP::SubtractRequested(), CDownloadTransferFTP::SubtractRequested(), CDownloadSource::TouchedRange(), and VerifySelection().

QWORD CDownloadTransfer::m_nOffset
 

Definition at line 53 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), CDownloadTransferHTTP::Close(), CDownloadTransferFTP::Close(), CFragmentBar::DrawSource(), CFragmentBar::DrawSourceImpl(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferFTP::CFTPRETR::OnRead(), CDownloadTransferHTTP::ReadContent(), CDownloadTransferFTP::SendCommand(), CDownloadTransferHTTP::SendRequest(), CDownloadTransferHTTP::StartNextFragment(), CDownloadTransferFTP::StartNextFragment(), CDownloadTransferHTTP::SubtractRequested(), CDownloadTransferFTP::SubtractRequested(), CDownloadSource::TouchedRange(), and VerifySelection().

QWORD CDownloadTransfer::m_nPosition
 

Definition at line 55 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), CDownloadTransferHTTP::Close(), CDownloadTransferFTP::Close(), CFragmentBar::DrawSourceImpl(), CDownloadTransferHTTP::GetAverageSpeed(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferFTP::CFTPRETR::OnRead(), CDownloadTransferHTTP::ReadContent(), CDownloadTransferHTTP::StartNextFragment(), and CDownloadTransferFTP::StartNextFragment().

PROTOCOLID CDownloadTransfer::m_nProtocol
 

Definition at line 42 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), CFragmentBar::DrawSource(), CDownloadWithTransfers::OnAcceptPush(), CDownloadWithTransfers::OnDonkeyCallback(), and SetState().

int CDownloadTransfer::m_nQueueLen
 

Definition at line 50 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), GetStateText(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferED2K::OnRankingInfo(), CDownloadTransferHTTP::ReadFlush(), and CDownloadTransferED2K::SetQueueRank().

int CDownloadTransfer::m_nQueuePos
 

Definition at line 49 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), GetStateText(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferED2K::OnQueueRank(), CDownloadTransferED2K::OnRankingInfo(), CDownloadTransferHTTP::ReadFlush(), CDownloadTransferED2K::RunQueued(), CDownloadTransferED2K::SetQueueRank(), and SetState().

int CDownloadTransfer::m_nState
 

Definition at line 48 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), CDownloadTransferBT::CDownloadTransferBT(), CEDClient::Close(), CDownloadTransferHTTP::Close(), CDownloadTransferFTP::Close(), CEDClient::Connect(), CFragmentBar::DrawSourceImpl(), CDownloadTransferHTTP::GetAverageSpeed(), CDownloadTransferBT::GetStateText(), GetStateText(), CDownloadTransferED2K::Initiate(), CDownloadTransferBT::Initiate(), CDownloadWithTransfers::OnAcceptPush(), CDownloadTransferED2K::OnCompressedPart(), CDownloadWithTransfers::OnDonkeyCallback(), CDownloadTransferHTTP::OnDropped(), CDownloadTransferFTP::OnDropped(), CDownloadTransferED2K::OnDropped(), CDownloadTransferED2K::OnFileStatus(), CDownloadTransferED2K::OnHashsetAnswer(), CDownloadTransferBT::OnPiece(), CDownloadTransferED2K::OnQueueRank(), CDownloadTransferED2K::OnRankingInfo(), CDownloadTransferHTTP::OnRead(), CEDClient::OnRun(), CDownloadTransferHTTP::OnRun(), CDownloadTransferFTP::OnRun(), CDownloadTransferBT::OnRun(), CDownloads::OnRun(), CDownloadTransferED2K::OnRunEx(), CDownloadTransferED2K::OnSendingPart(), CDownloadTransferED2K::RunQueued(), CDownloadTransferED2K::Send(), CDownloadTransferED2K::SendFragmentRequests(), CDownloadTransferBT::SendRequests(), CDownloadTransferED2K::SendSecondaryRequest(), SetState(), CDownloadTransferHTTP::SubtractRequested(), CDownloadTransferFTP::SubtractRequested(), CDownloadTransferED2K::SubtractRequested(), and CDownloadSource::TouchedRange().

CDownloadTransfer* CDownloadTransfer::m_pDlNext
 

Definition at line 45 of file DownloadTransfer.h.

Referenced by CDownloadWithTransfers::AddTransfer(), CDownloadTransfer(), CDownloadWithTransfers::GetAmountDownloadedFrom(), CDownloadWithTransfers::GetAverageSpeed(), CDownloadWithTransfers::GetMeasuredSpeed(), CDownloadWithTransfers::GetTransferCount(), and CDownloadWithTransfers::RemoveTransfer().

CDownloadTransfer* CDownloadTransfer::m_pDlPrev
 

Definition at line 44 of file DownloadTransfer.h.

Referenced by CDownloadWithTransfers::AddTransfer(), CDownloadTransfer(), and CDownloadWithTransfers::RemoveTransfer().

CDownload* CDownloadTransfer::m_pDownload
 

Definition at line 43 of file DownloadTransfer.h.

Referenced by CDownloadTransferHTTP::AcceptPush(), CDownloadTransfer(), CDownloadTransferBT::CDownloadTransferBT(), CDownloadTransferED2K::CDownloadTransferED2K(), ChunkifyRequest(), Close(), CDownloadTransferHTTP::Initiate(), CDownloadTransferFTP::Initiate(), CDownloadTransferED2K::Initiate(), CEDClient::Merge(), CDownloadTransferBT::OnBitfield(), CDownloadTransferBT::OnChoked(), CDownloadTransferED2K::OnCompressedPart(), CDownloadTransferBT::OnConnected(), CDownloadTransferED2K::OnDropped(), CDownloadTransferED2K::OnFileComment(), CDownloadTransferED2K::OnFileNotFound(), CDownloadTransferED2K::OnFileReqAnswer(), CDownloadTransferED2K::OnFileStatus(), CDownloadTransferED2K::OnHashsetAnswer(), CDownloadTransferBT::OnHave(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferFTP::OnHeaderLine(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferBT::OnPiece(), CDownloadTransferFTP::CFTPRETR::OnRead(), CDownloadTransferED2K::OnSendingPart(), CDownloadTransferBT::OnSourceResponse(), CDownloadTransferHTTP::ReadContent(), CDownloadTransferHTTP::ReadMetadata(), CDownloadTransferHTTP::ReadTiger(), CDownloadTransferED2K::RunQueued(), CDownloadTransferBT::SelectFragment(), CDownloadTransferED2K::SendFragmentRequests(), CDownloadTransferED2K::SendPrimaryRequest(), CDownloadTransferHTTP::SendRequest(), CDownloadTransferBT::SendRequests(), CDownloadTransferED2K::SendSecondaryRequest(), SetState(), CDownloadTransferBT::ShowInterest(), CDownloadTransferHTTP::StartNextFragment(), CDownloadTransferFTP::StartNextFragment(), and CDownloadTransferBT::UnrequestRange().

CDownloadSource* CDownloadTransfer::m_pSource
 

Definition at line 46 of file DownloadTransfer.h.

Referenced by CDownloadTransfer(), ChunkifyRequest(), CDownloadTransferHTTP::Close(), CDownloadTransferFTP::Close(), Close(), CEDClient::DeriveSoftwareVersion(), CEDClient::DeriveVersion(), CBTClient::DetermineUserAgent(), CDownloadTransferHTTP::GetAverageSpeed(), CDownloadTransferFTP::GetAverageSpeed(), CDownloadTransferED2K::GetAverageSpeed(), CDownloadTransferBT::GetAverageSpeed(), CDownloadTransferHTTP::Initiate(), CDownloadTransferFTP::Initiate(), CDownloadTransferED2K::Initiate(), CBTClient::OnBeHandshake(), CDownloadTransferBT::OnBitfield(), CDownloadTransferED2K::OnCompressedPart(), CDownloadTransferED2K::OnConnected(), CDownloadTransferBT::OnConnected(), CEDClient::OnDownloadClose(), CDownloadTransferHTTP::OnDropped(), CDownloadTransferFTP::OnDropped(), CDownloadSource::OnFailure(), CDownloadTransferED2K::OnFileReqAnswer(), CDownloadTransferED2K::OnFileStatus(), CBTClient::OnHandshake2(), CDownloadTransferBT::OnHave(), CDownloadTransferHTTP::OnHeaderLine(), CDownloadTransferFTP::OnHeaderLine(), CDownloadTransferHTTP::OnHeadersComplete(), CDownloadTransferBT::OnPiece(), CDownloadTransferED2K::OnQueueRank(), CDownloadTransferFTP::CFTPRETR::OnRead(), CDownloadTransferHTTP::OnRun(), CDownloadTransferFTP::OnRun(), CDownloadTransferED2K::OnSendingPart(), CEDClient::OnUdpQueueFull(), CDownloadTransferHTTP::ReadContent(), CDownloadSource::Remove(), CDownloadTransferFTP::SendCommand(), CDownloadTransferHTTP::SendRequest(), CDownloadTransferED2K::SendSecondaryRequest(), SetState(), CDownloadTransferHTTP::StartNextFragment(), CDownloadTransferFTP::StartNextFragment(), VerifySelection(), and ~CDownloadTransfer().

CString CDownloadTransfer::m_sQueueName
 

Definition at line 51 of file DownloadTransfer.h.

Referenced by GetStateText(), CDownloadTransferHTTP::OnHeaderLine(), and CDownloadTransferHTTP::ReadFlush().


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