#include <DownloadTransferBT.h>
Inheritance diagram for CDownloadTransferBT:
Public Member Functions | |
CDownloadTransferBT (CDownloadSource *pSource, CBTClient *pClient) | |
virtual | ~CDownloadTransferBT () |
virtual BOOL | Initiate () |
virtual void | Close (TRISTATE bKeepSource) |
virtual void | Boost () |
virtual DWORD | GetAverageSpeed () |
virtual DWORD | GetMeasuredSpeed () |
virtual CString | GetStateText (BOOL bLong) |
virtual BOOL | OnRun () |
virtual BOOL | OnConnected () |
virtual BOOL | SubtractRequested (FF::SimpleFragmentList &ppFragments) |
virtual BOOL | UnrequestRange (QWORD nOffset, QWORD nLength) |
BOOL | OnBitfield (CBTPacket *pPacket) |
BOOL | OnHave (CBTPacket *pPacket) |
BOOL | OnChoked (CBTPacket *pPacket) |
BOOL | OnUnchoked (CBTPacket *pPacket) |
BOOL | OnPiece (CBTPacket *pPacket) |
BOOL | OnSourceResponse (CBTPacket *pPacket) |
void | SendFinishedBlock (DWORD nBlock) |
Public Attributes | |
CBTClient * | m_pClient |
BOOL | m_bChoked |
BOOL | m_bInterested |
BYTE * | m_pAvailable |
FF::SimpleFragmentQueue | m_oRequested |
DWORD | m_tRunThrottle |
DWORD | m_tSourceRequest |
Protected Member Functions | |
void | Send (CBTPacket *pPacket, BOOL bRelease=TRUE) |
void | ShowInterest () |
BOOL | SendRequests () |
BOOL | SelectFragment (const FF::SimpleFragmentList &oPossible, QWORD &nOffset, QWORD &nLength) |
|
Definition at line 47 of file DownloadTransferBT.cpp. References dtsConnecting, dtsNull, CDownloadBase::m_bBTH, m_bChoked, m_bInterested, CDownloadBase::m_nSize, CDownloadTransfer::m_nState, m_pAvailable, m_pClient, CDownloadTransfer::m_pDownload, CConnection::m_sUserAgent, m_tRunThrottle, m_tSourceRequest, NULL, and SIZE_UNKNOWN. |
|
Definition at line 65 of file DownloadTransferBT.cpp. References m_pAvailable, m_pClient, and NULL. |
|
Reimplemented from CDownloadTransfer. Definition at line 118 of file DownloadTransferBT.cpp. References CConnection::m_mInput, m_pClient, NULL, and TCPBandwidthMeter::pLimit. |
|
Reimplemented from CDownloadTransfer. Definition at line 97 of file DownloadTransferBT.cpp. References BT_PACKET_NOT_INTERESTED, CTransfer::Close(), CBTClient::Close(), CBTClient::IsOnline(), m_pClient, CBTClient::m_pDownloadTransfer, CBTPacket::New(), NULL, and CBTClient::Send(). Referenced by CBTClient::Close(). |
|
Reimplemented from CDownloadTransfer. Definition at line 124 of file DownloadTransferBT.cpp. References GetMeasuredSpeed(), CDownloadSource::m_nSpeed, and CDownloadTransfer::m_pSource. Referenced by CDownloadWithTorrent::ChokeTorrent(). |
|
Reimplemented from CDownloadTransfer. Definition at line 129 of file DownloadTransferBT.cpp. References CConnection::m_mInput, m_pClient, CConnection::Measure(), TCPBandwidthMeter::nMeasure, and NULL. Referenced by GetAverageSpeed(). |
|
Reimplemented from CDownloadTransfer. Definition at line 136 of file DownloadTransferBT.cpp. References dtsTorrent, CDownloadTransfer::GetStateText(), IDS_STATUS_CHOKED, IDS_STATUS_REQUESTING, IDS_STATUS_UNINTERESTED, LoadString(), m_bChoked, m_bInterested, and CDownloadTransfer::m_nState. |
|
Implements CDownloadTransfer. Definition at line 74 of file DownloadTransferBT.cpp. References CTransfer::Close(), CBTClient::Connect(), dtsConnecting, dtsNull, CDownloadTransfer::m_nState, m_pClient, CConnection::m_pHost, CConnection::m_sAddress, CConnection::m_tConnected, NULL, CDownloadTransfer::SetState(), and TS_FALSE. |
|
|
|
Reimplemented from CConnection. Definition at line 184 of file DownloadTransferBT.cpp. References CTransfer::Close(), Downloads, dtsTorrent, IDS_DOWNLOAD_CONNECTED, CDownload::IsCompleted(), CConnection::m_mInput, CDownloads::m_nLimitGeneric, m_pClient, CDownloadTransfer::m_pDownload, CConnection::m_pHost, CDownloadTransfer::m_pSource, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, NULL, TCPBandwidthMeter::pLimit, CDownloadWithFile::PrepareFile(), CDownloadSource::SetLastSeen(), CDownloadTransfer::SetState(), theApp, TS_FALSE, and TS_TRUE. Referenced by CBTClient::OnOnline(). |
|
|
|
Reimplemented from CDownloadTransfer. Definition at line 161 of file DownloadTransferBT.cpp. References CSettings::BitTorrent, BT_PACKET_SOURCE_REQUEST, dtsDownloading, dtsRequesting, dtsTorrent, CBTClient::m_bExchange, CDownloadTransfer::m_nState, m_pClient, m_tRunThrottle, m_tSourceRequest, CBTPacket::New(), CDownloadTransfer::OnRun(), Send(), SendRequests(), Settings, ShowInterest(), and CSettings::sBitTorrent::SourceExchangePeriod. Referenced by CBTClient::OnRun(). |
|
|
Definition at line 356 of file DownloadTransferBT.cpp. References FF::detail::Queue::clear(), dtsTorrent, m_bChoked, m_oRequested, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEBUG, SendRequests(), CDownloadTransfer::SetState(), and theApp. Referenced by CBTClient::OnPacket(). |
|
|
Definition at line 152 of file DownloadTransferBT.cpp. References m_pClient, NULL, and CBTClient::Send(). Referenced by OnChoked(), OnRun(), SendFinishedBlock(), SendRequests(), ShowInterest(), and UnrequestRange(). |
|
Definition at line 256 of file DownloadTransferBT.cpp. References BT_PACKET_HAVE, CBTClient::IsOnline(), m_pClient, CBTPacket::New(), NULL, Send(), and CPacket::WriteLongBE(). |
|
|
Definition at line 289 of file DownloadTransferBT.cpp. References BT_PACKET_INTERESTED, BT_PACKET_NOT_INTERESTED, FF::detail::Queue::clear(), CDownloadWithFile::GetEmptyFragmentList(), m_bInterested, CBTInfo::m_nBlockSize, m_oRequested, m_pAvailable, CDownloadTransfer::m_pDownload, CDownloadWithTorrent::m_pTorrent, CBTPacket::New(), NULL, and Send(). Referenced by OnBitfield(), OnHave(), OnPiece(), and OnRun(). |
|
Implements CDownloadTransfer. Definition at line 467 of file DownloadTransferBT.cpp. References FF::detail::Queue::begin(), FF::detail::Queue::empty(), FF::detail::Queue::end(), detail::List< FragmentT, ContainerT >::erase(), m_bChoked, and m_oRequested. |
|
Reimplemented from CDownloadTransfer. Definition at line 474 of file DownloadTransferBT.cpp. References FF::detail::Queue::begin(), BT_PACKET_CANCEL, FF::detail::Queue::empty(), FF::detail::Queue::end(), detail::extractRange(), CBTInfo::m_nBlockSize, m_oRequested, CDownloadTransfer::m_pDownload, CDownloadWithTorrent::m_pTorrent, CBTPacket::New(), Send(), and CPacket::WriteLongBE(). |
|
Definition at line 43 of file DownloadTransferBT.h. Referenced by CDownloadTransferBT(), GetStateText(), OnChoked(), CDownloads::OnRun(), OnUnchoked(), SendRequests(), CDownloadTransfer::SetState(), and SubtractRequested(). |
|
Definition at line 44 of file DownloadTransferBT.h. Referenced by CDownloadTransferBT(), GetStateText(), SendRequests(), CDownloadTransfer::SetState(), and ShowInterest(). |
|
Definition at line 47 of file DownloadTransferBT.h. Referenced by OnChoked(), OnPiece(), OnUnchoked(), SendRequests(), ShowInterest(), SubtractRequested(), and UnrequestRange(). |
|
Definition at line 46 of file DownloadTransferBT.h. Referenced by CDownloadTransferBT(), OnBitfield(), OnHave(), SelectFragment(), ShowInterest(), and ~CDownloadTransferBT(). |
|
Definition at line 42 of file DownloadTransferBT.h. Referenced by Boost(), CDownloadTransferBT(), CDownloadWithTorrent::ChokeTorrent(), Close(), GetMeasuredSpeed(), Initiate(), OnConnected(), OnPiece(), OnRun(), Send(), SendFinishedBlock(), and ~CDownloadTransferBT(). |
|
Definition at line 48 of file DownloadTransferBT.h. Referenced by CDownloadTransferBT(), and OnRun(). |
|
Definition at line 49 of file DownloadTransferBT.h. Referenced by CDownloadTransferBT(), and OnRun(). |