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

CUploadTransferED2K Class Reference

#include <UploadTransferED2K.h>

Inheritance diagram for CUploadTransferED2K:

CUploadTransfer CTransfer CConnection List of all members.

Public Member Functions

 CUploadTransferED2K (CEDClient *pClient)
virtual ~CUploadTransferED2K ()
BOOL Request (MD4 *pMD4)
virtual void Close (BOOL bMessage=FALSE)
virtual BOOL OnRun ()
virtual BOOL OnConnected ()
virtual void OnDropped (BOOL bError)
virtual void OnQueueKick ()
virtual DWORD GetMeasuredSpeed ()
BOOL OnRunEx (DWORD tNow)
BOOL OnQueueRelease (CEDPacket *pPacket)
BOOL OnRequestParts (CEDPacket *pPacket)
BOOL OnReask ()

Public Attributes

CEDClientm_pClient
DWORD m_tRequest
int m_nRanking
DWORD m_tRankingSent
DWORD m_tRankingCheck
DWORD m_tLastRun

Protected Member Functions

void Cleanup (BOOL bDequeue=TRUE)
void Send (CEDPacket *pPacket, BOOL bRelease=TRUE)
BOOL CheckRanking ()
void AddRequest (QWORD nOffset, QWORD nLength)
BOOL ServeRequests ()
BOOL OpenFile ()
BOOL StartNextRequest ()
BOOL DispatchNextChunk ()
BOOL CheckFinishedRequest ()

Private Attributes

FF::SimpleFragmentQueue m_oRequested
FF::SimpleFragmentQueue m_oServed

Constructor & Destructor Documentation

CUploadTransferED2K::CUploadTransferED2K CEDClient pClient  ) 
 

Definition at line 53 of file UploadTransferED2K.cpp.

References CConnection::m_mOutput, CUploadTransfer::m_nBandwidth, CUploadTransfer::m_nState, m_pClient, CConnection::m_pHost, CConnection::m_sAddress, CEDClient::m_sNick, CUploadTransfer::m_sNick, CConnection::m_sUserAgent, m_tLastRun, m_tRankingCheck, m_tRankingSent, m_tRequest, NULL, TCPBandwidthMeter::pLimit, and upsReady.

CUploadTransferED2K::~CUploadTransferED2K  )  [virtual]
 

Definition at line 73 of file UploadTransferED2K.cpp.

References m_pClient, and NULL.


Member Function Documentation

void CUploadTransferED2K::AddRequest QWORD  nOffset,
QWORD  nLength
[protected]
 

Definition at line 424 of file UploadTransferED2K.cpp.

References FF::detail::Queue::begin(), FF::detail::Queue::end(), m_oRequested, CUploadTransfer::m_pBaseFile, NULL, and FF::detail::Queue::pushBack().

Referenced by OnRequestParts().

BOOL CUploadTransferED2K::CheckFinishedRequest  )  [protected]
 

Definition at line 647 of file UploadTransferED2K.cpp.

References CUploadFile::AddFragment(), IDS_UPLOAD_FINISHED, CUploadTransfer::m_nLength, CUploadTransfer::m_nOffset, CUploadTransfer::m_nPosition, CUploadTransfer::m_nState, m_oServed, CUploadTransfer::m_pBaseFile, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CShareazaApp::Message(), MSG_DEFAULT, FF::detail::Queue::pushBack(), SIZE_UNKNOWN, theApp, and upsUploading.

Referenced by ServeRequests().

BOOL CUploadTransferED2K::CheckRanking  )  [protected]
 

Definition at line 666 of file UploadTransferED2K.cpp.

References CUploadQueues::Check(), Cleanup(), CTransfer::Close(), CEDClient::Connect(), ED2K_C2C_QUEUERANK, ED2K_C2C_QUEUERANKING, ED2K_C2C_STARTUPLOAD, ED2K_PROTOCOL_EMULE, CSettings::eDonkey, CUploadQueues::GetPosition(), CUploadQueue::GetQueuedCount(), IDS_UPLOAD_QUEUED, CEDClient::IsOnline(), CEDClient::m_bEmule, m_nRanking, CUploadTransfer::m_nState, m_pClient, CUploadTransfer::m_pQueue, CUploadQueues::m_pSection, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CUploadQueue::m_sName, m_tRankingCheck, m_tRankingSent, m_tRequest, CShareazaApp::Message(), MSG_DEFAULT, CEDPacket::New(), CSettings::seDonkey::QueueRankThrottle, Send(), Settings, theApp, UploadQueues, upsConnecting, upsQueued, upsRequest, upsUploading, CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by OnConnected(), OnQueueKick(), OnRunEx(), and Request().

void CUploadTransferED2K::Cleanup BOOL  bDequeue = TRUE  )  [protected]
 

Definition at line 388 of file UploadTransferED2K.cpp.

References FF::detail::Queue::clear(), CUploadTransfer::ClearRequest(), CUploadTransfer::CloseFile(), CUploadQueues::Dequeue(), CUploadTransfer::m_nOffset, CUploadTransfer::m_nPosition, CUploadTransfer::m_nState, m_oRequested, m_oServed, CUploadTransfer::m_pBaseFile, CUploadTransfer::m_pDiskFile, NULL, UploadQueues, upsReady, and upsUploading.

Referenced by CheckRanking(), Close(), OnQueueKick(), OnQueueRelease(), OpenFile(), Request(), ServeRequests(), and StartNextRequest().

void CUploadTransferED2K::Close BOOL  bMessage = FALSE  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 144 of file UploadTransferED2K.cpp.

References Cleanup(), CTransfer::Close(), ED2K_C2C_FILENOTFOUND, ED2K_C2C_FINISHUPLOAD, CEDClient::IsOnline(), CUploadTransfer::m_nState, CUploadTransfer::m_pBaseFile, m_pClient, CUploadTransfer::m_pED2K, CEDPacket::New(), NULL, CEDClient::OnUploadClose(), Send(), upsNull, upsQueued, upsUploading, and CPacket::Write().

Referenced by CEDClient::DetachUpload().

BOOL CUploadTransferED2K::DispatchNextChunk  )  [protected]
 

Definition at line 580 of file UploadTransferED2K.cpp.

References CStatistics::Current, ED2K_C2C_SENDINGPART, ED2K_PROTOCOL_EDONKEY, CSettings::eDonkey, CBuffer::EnsureBuffer(), CSettings::seDonkey::FrameSize, CUploadTransfer::m_nFileBase, CBuffer::m_nLength, CPacket::m_nLength, CUploadTransfer::m_nLength, CUploadTransfer::m_nOffset, CUploadTransfer::m_nPosition, CUploadTransfer::m_nState, CUploadTransfer::m_nUploaded, CBuffer::m_pBuffer, m_pClient, CUploadTransfer::m_pDiskFile, CUploadTransfer::m_pED2K, CConnection::m_pOutput, CEDPacket::New(), ED2K_PART_HEADER::nLength, ED2K_PART_HEADER::nOffset1, ED2K_PART_HEADER::nOffset2, ED2K_PART_HEADER::nProtocol, ED2K_PART_HEADER::nType, NULL, ED2K_PART_HEADER::pMD4, CTransferFile::Read(), CPacket::Release(), CEDClient::Send(), Send(), Settings, SIZE_UNKNOWN, Statistics, upsUploading, CPacket::Write(), and CPacket::WriteLongLE().

Referenced by ServeRequests().

DWORD CUploadTransferED2K::GetMeasuredSpeed  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 311 of file UploadTransferED2K.cpp.

References CConnection::m_mOutput, m_pClient, CConnection::Measure(), TCPBandwidthMeter::nMeasure, and NULL.

BOOL CUploadTransferED2K::OnConnected  )  [virtual]
 

Reimplemented from CConnection.

Definition at line 250 of file UploadTransferED2K.cpp.

References CheckRanking(), CConnection::m_mOutput, CUploadTransfer::m_nBandwidth, m_nRanking, CUploadTransfer::m_nState, m_pClient, m_tRequest, TCPBandwidthMeter::pLimit, and upsConnecting.

Referenced by CEDClient::OnLoggedIn().

void CUploadTransferED2K::OnDropped BOOL  bError  )  [virtual]
 

Reimplemented from CConnection.

Definition at line 265 of file UploadTransferED2K.cpp.

References FF::detail::Queue::clear(), CTransfer::Close(), IDS_UPLOAD_DROPPED, IDS_UPLOAD_QUEUE_DROP, CUploadTransfer::m_nState, m_oRequested, m_oServed, CConnection::m_sAddress, m_tRequest, CShareazaApp::Message(), MSG_DEFAULT, MSG_ERROR, theApp, and upsQueued.

Referenced by CEDClient::NotifyDropped().

void CUploadTransferED2K::OnQueueKick  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 287 of file UploadTransferED2K.cpp.

References CheckRanking(), Cleanup(), ED2K_C2C_FINISHUPLOAD, CUploadQueues::GetPosition(), CEDClient::IsOnline(), m_nRanking, CUploadTransfer::m_nState, CUploadTransfer::m_pBaseFile, m_pClient, CEDPacket::New(), NULL, Send(), UploadQueues, upsRequest, and upsUploading.

BOOL CUploadTransferED2K::OnQueueRelease CEDPacket pPacket  ) 
 

Definition at line 321 of file UploadTransferED2K.cpp.

References Cleanup(), and CTransfer::Close().

Referenced by CEDClient::OnPacket().

BOOL CUploadTransferED2K::OnReask  ) 
 

Definition at line 763 of file UploadTransferED2K.cpp.

References Datagrams, ED2K_C2C_UDP_REASKACK, ED2K_PROTOCOL_EMULE, CUploadQueues::GetPosition(), CUploadTransfer::m_nState, CEDClient::m_nUDP, m_pClient, CConnection::m_pHost, m_tRequest, CEDPacket::New(), CDatagrams::Send(), UploadQueues, upsQueued, and CPacket::WriteShortLE().

Referenced by CEDClient::OnUdpReask().

BOOL CUploadTransferED2K::OnRequestParts CEDPacket pPacket  ) 
 

Definition at line 331 of file UploadTransferED2K.cpp.

References AddRequest(), CTransfer::Close(), CPacket::GetRemaining(), IDS_ED2K_CLIENT_BAD_PACKET, CUploadTransfer::m_nFileSize, CUploadTransfer::m_nState, CEDPacket::m_nType, CUploadTransfer::m_pED2K, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, CPacket::Read(), Request(), ServeRequests(), theApp, upsQueued, upsRequest, and upsUploading.

Referenced by CEDClient::OnPacket().

BOOL CUploadTransferED2K::OnRun  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 177 of file UploadTransferED2K.cpp.

References OnRunEx().

BOOL CUploadTransferED2K::OnRunEx DWORD  tNow  ) 
 

Definition at line 182 of file UploadTransferED2K.cpp.

References CheckRanking(), CTransfer::Close(), CSettings::Connection, CSettings::seDonkey::DequeueTime, CSettings::eDonkey, IDS_UPLOAD_QUEUE_TIMEOUT, IDS_UPLOAD_REQUEST_TIMEOUT, IDS_UPLOAD_TRAFFIC_TIMEOUT, CEDClient::IsOnline(), CConnection::m_mOutput, m_nRanking, CUploadTransfer::m_nState, m_pClient, CConnection::m_sAddress, m_tLastRun, m_tRankingCheck, m_tRequest, CShareazaApp::Message(), MSG_ERROR, CUploadTransfer::OnRun(), ServeRequests(), Settings, CSettings::seDonkey::SourceThrottle, theApp, CSettings::sConnection::TimeoutConnect, CSettings::sConnection::TimeoutHandshake, CSettings::sConnection::TimeoutTraffic, TCPBandwidthMeter::tLast, upsConnecting, upsQueued, upsReady, upsRequest, and upsUploading.

Referenced by OnRun(), and CEDClient::OnRunEx().

BOOL CUploadTransferED2K::OpenFile  )  [protected]
 

Definition at line 501 of file UploadTransferED2K.cpp.

References Cleanup(), CTransfer::Close(), ED2K_C2C_FILENOTFOUND, IDS_UPLOAD_CANTOPEN, Library, LibraryMaps, CLibraryMaps::LookupFileByPath(), CUploadTransfer::m_nState, CUploadTransfer::m_pBaseFile, CUploadTransfer::m_pDiskFile, CUploadTransfer::m_pED2K, CLibrary::m_pSection, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CUploadTransfer::m_sFilePath, CShareazaApp::Message(), MSG_ERROR, CEDPacket::New(), NULL, CTransferFiles::Open(), Send(), theApp, TransferFiles, upsRequest, upsUploading, and CPacket::Write().

Referenced by ServeRequests().

BOOL CUploadTransferED2K::Request MD4 pMD4  ) 
 

Definition at line 81 of file UploadTransferED2K.cpp.

References CUploadTransfer::AllocateBaseFile(), CheckRanking(), Cleanup(), CTransfer::Close(), CUploadQueues::Dequeue(), Downloads, ED2K_C2C_FILENOTFOUND, CUploadQueues::Enqueue(), CDownloads::FindByED2K(), CUploadQueues::GetPosition(), CED2K::HashToString(), IDS_UPLOAD_BUSY_QUEUE, IDS_UPLOAD_FILE, IDS_UPLOAD_FILENOTFOUND, Library, LibraryMaps, CLibraryMaps::LookupFileByED2K(), CUploadTransfer::m_bED2K, m_nRanking, m_pClient, CUploadTransfer::m_pED2K, CLibrary::m_pSection, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CShareazaApp::Message(), MSG_ERROR, MSG_SYSTEM, CEDPacket::New(), CUploadTransfer::RequestComplete(), CUploadTransfer::RequestPartial(), Send(), theApp, UploadQueues, and CPacket::Write().

Referenced by CEDClient::OnQueueRequest(), and OnRequestParts().

void CUploadTransferED2K::Send CEDPacket pPacket,
BOOL  bRelease = TRUE
[protected]
 

Definition at line 414 of file UploadTransferED2K.cpp.

References CUploadTransfer::m_nState, m_pClient, NULL, CEDClient::Send(), and upsNull.

Referenced by CheckRanking(), Close(), DispatchNextChunk(), OnQueueKick(), OpenFile(), Request(), ServeRequests(), and StartNextRequest().

BOOL CUploadTransferED2K::ServeRequests  )  [protected]
 

Definition at line 439 of file UploadTransferED2K.cpp.

References CheckFinishedRequest(), Cleanup(), CTransfer::Close(), DispatchNextChunk(), ED2K_C2C_FINISHUPLOAD, CSettings::eDonkey, CSettings::seDonkey::FrameSize, CUploadQueues::GetPosition(), CEDClient::IsOnline(), CUploadTransfer::m_bStopTransfer, CUploadTransfer::m_nLength, CBuffer::m_nLength, m_nRanking, CUploadTransfer::m_nState, CUploadTransfer::m_pBaseFile, m_pClient, CConnection::m_pOutput, CUploadTransfer::m_pQueue, m_tRequest, CUploadTransfer::m_tRotateTime, CEDPacket::New(), NULL, OpenFile(), Send(), Settings, SIZE_UNKNOWN, StartNextRequest(), UploadQueues, upsQueued, upsRequest, and upsUploading.

Referenced by OnRequestParts(), and OnRunEx().

BOOL CUploadTransferED2K::StartNextRequest  )  [protected]
 

Definition at line 536 of file UploadTransferED2K.cpp.

References FF::detail::Queue::begin(), Cleanup(), CTransfer::Close(), ED2K_C2C_FINISHUPLOAD, FF::detail::Queue::empty(), FF::detail::Queue::end(), IDS_UPLOAD_CONTENT, CConnection::m_mOutput, CUploadTransfer::m_nFileSize, CUploadTransfer::m_nLength, CUploadTransfer::m_nOffset, CUploadTransfer::m_nPosition, CUploadTransfer::m_nState, m_oRequested, m_oServed, m_pClient, CUploadTransfer::m_pDiskFile, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CConnection::m_sUserAgent, CUploadTransfer::m_tContent, CShareazaApp::Message(), MSG_DEFAULT, CEDPacket::New(), NULL, FF::detail::Queue::popFront(), Send(), SIZE_UNKNOWN, theApp, TCPBandwidthMeter::tLast, upsRequest, and upsUploading.

Referenced by ServeRequests().


Member Data Documentation

int CUploadTransferED2K::m_nRanking
 

Definition at line 44 of file UploadTransferED2K.h.

Referenced by CheckRanking(), OnConnected(), OnQueueKick(), OnRunEx(), Request(), and ServeRequests().

FF::SimpleFragmentQueue CUploadTransferED2K::m_oRequested [private]
 

Definition at line 49 of file UploadTransferED2K.h.

Referenced by AddRequest(), Cleanup(), OnDropped(), and StartNextRequest().

FF::SimpleFragmentQueue CUploadTransferED2K::m_oServed [private]
 

Definition at line 50 of file UploadTransferED2K.h.

Referenced by CheckFinishedRequest(), Cleanup(), OnDropped(), and StartNextRequest().

CEDClient* CUploadTransferED2K::m_pClient
 

Definition at line 42 of file UploadTransferED2K.h.

Referenced by CheckRanking(), Close(), CUploadTransferED2K(), DispatchNextChunk(), GetMeasuredSpeed(), CEDClient::Merge(), OnConnected(), OnQueueKick(), OnReask(), OnRunEx(), Request(), Send(), ServeRequests(), StartNextRequest(), and ~CUploadTransferED2K().

DWORD CUploadTransferED2K::m_tLastRun
 

Definition at line 47 of file UploadTransferED2K.h.

Referenced by CUploadTransferED2K(), and OnRunEx().

DWORD CUploadTransferED2K::m_tRankingCheck
 

Definition at line 46 of file UploadTransferED2K.h.

Referenced by CheckRanking(), CUploadTransferED2K(), and OnRunEx().

DWORD CUploadTransferED2K::m_tRankingSent
 

Definition at line 45 of file UploadTransferED2K.h.

Referenced by CheckRanking(), and CUploadTransferED2K().

DWORD CUploadTransferED2K::m_tRequest
 

Definition at line 43 of file UploadTransferED2K.h.

Referenced by CheckRanking(), CUploadTransferED2K(), OnConnected(), OnDropped(), OnReask(), OnRunEx(), and ServeRequests().


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