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

CDownloadWithTiger Class Reference

#include <DownloadWithTiger.h>

Inheritance diagram for CDownloadWithTiger:

CDownloadWithTorrent CDownloadWithFile CDownloadWithTransfers CDownloadWithSources CDownloadBase CDownloadWithSearch CDownloadWithExtras CDownload List of all members.

Public Member Functions

 CDownloadWithTiger ()
virtual ~CDownloadWithTiger ()
DWORD GetValidationCookie () const
QWORD GetVerifyLength (int nHash=HASH_NULL) const
BOOL GetNextVerifyRange (QWORD &nOffset, QWORD &nLength, BOOL &bSuccess, int nHash=HASH_NULL) const
BOOL IsFullyVerified ()
BOOL NeedTigerTree () const
BOOL SetTigerTree (BYTE *pTiger, DWORD nTiger)
CTigerTreeGetTigerTree ()
BOOL NeedHashset () const
BOOL SetHashset (BYTE *pSource, DWORD nSource)
CED2KGetHashset ()
virtual CString GetAvailableRanges () const
virtual void ResetVerification ()
virtual void ClearVerification ()
virtual void Serialize (CArchive &ar, int nVersion)

Protected Member Functions

BOOL ValidationCanFinish () const
void RunValidation (BOOL bSeeding)

Private Member Functions

BOOL FindNewValidationBlock (int nHash)
void ContinueValidation ()
void FinishValidation ()
void SubtractHelper (FF::SimpleFragmentList &ppCorrupted, BYTE *pBlock, QWORD nBlock, QWORD nSize)

Private Attributes

CTigerTree m_pTigerTree
BYTE * m_pTigerBlock
DWORD m_nTigerBlock
DWORD m_nTigerSize
DWORD m_nTigerSuccess
CED2K m_pHashset
BYTE * m_pHashsetBlock
DWORD m_nHashsetBlock
DWORD m_nHashsetSuccess
DWORD m_nVerifyCookie
int m_nVerifyHash
DWORD m_nVerifyBlock
QWORD m_nVerifyOffset
QWORD m_nVerifyLength
DWORD m_tVerifyLast

Friends

class CEDClient
class CDownloadTipCtrl

Constructor & Destructor Documentation

CDownloadWithTiger::CDownloadWithTiger  ) 
 

Definition at line 45 of file DownloadWithTiger.cpp.

References HASH_NULL, m_nHashsetBlock, m_nHashsetSuccess, m_nTigerBlock, m_nTigerSuccess, m_nVerifyBlock, m_nVerifyCookie, m_nVerifyHash, m_pHashsetBlock, m_pTigerBlock, and NULL.

CDownloadWithTiger::~CDownloadWithTiger  )  [virtual]
 

Definition at line 60 of file DownloadWithTiger.cpp.

References m_pHashsetBlock, m_pTigerBlock, and NULL.


Member Function Documentation

void CDownloadWithTiger::ClearVerification  )  [virtual]
 

Definition at line 689 of file DownloadWithTiger.cpp.

References CED2K::Clear(), CTigerTree::Clear(), m_nHashsetBlock, m_nTigerBlock, m_nVerifyCookie, m_pHashset, m_pHashsetBlock, m_pTigerBlock, m_pTigerTree, NULL, ResetVerification(), and CDownloadBase::SetModified().

Referenced by CDownloadEditDlg::Commit(), CDownloadEditDlg::OnErase(), CDownloadEditDlg::OnLButtonUp(), and Serialize().

void CDownloadWithTiger::ContinueValidation  )  [private]
 

Definition at line 483 of file DownloadWithTiger.cpp.

References CBTInfo::AddToTest(), CED2K::AddToTest(), CTigerTree::AddToTest(), FinishValidation(), CFragmentedFile::GetRemaining(), HASH_ED2K, HASH_NULL, HASH_TIGERTREE, HASH_TORRENT, CTransfers::m_nBuffer, m_nVerifyBlock, m_nVerifyHash, m_nVerifyLength, m_nVerifyOffset, CTransfers::m_pBuffer, CDownloadWithFile::m_pFile, m_pHashset, m_pTigerTree, CDownloadWithTorrent::m_pTorrent, CDownloadBase::m_sLocalName, NULL, CFragmentedFile::ReadRange(), and Transfers.

Referenced by RunValidation().

BOOL CDownloadWithTiger::FindNewValidationBlock int  nHash  )  [private]
 

Definition at line 352 of file DownloadWithTiger.cpp.

References CBTInfo::BeginBlockTest(), CED2K::BeginBlockTest(), CTigerTree::BeginBlockTest(), CSettings::Downloads, ED2K_PART_SIZE, CFragmentedFile::GetEmptyFragmentList(), HASH_ED2K, HASH_TIGERTREE, HASH_TORRENT, m_nHashsetBlock, CDownloadBase::m_nSize, m_nTigerBlock, m_nTigerSize, CDownloadWithTorrent::m_nTorrentBlock, CDownloadWithTorrent::m_nTorrentSize, m_nVerifyBlock, m_nVerifyHash, m_nVerifyLength, m_nVerifyOffset, CDownloadWithFile::m_pFile, m_pHashset, m_pHashsetBlock, m_pTigerBlock, m_pTigerTree, CDownloadWithTorrent::m_pTorrent, CDownloadWithTorrent::m_pTorrentBlock, m_tVerifyLast, NULL, Settings, TS_FALSE, TS_TRUE, TS_UNKNOWN, CSettings::sDownloads::VerifyED2K, and CSettings::sDownloads::VerifyTiger.

Referenced by RunValidation().

void CDownloadWithTiger::FinishValidation  )  [private]
 

Definition at line 532 of file DownloadWithTiger.cpp.

References ED2K_PART_SIZE, detail::List< FragmentT, ContainerT >::empty(), detail::List< FragmentT, ContainerT >::end(), CBTInfo::FinishBlockTest(), CED2K::FinishBlockTest(), CTigerTree::FinishBlockTest(), HASH_ED2K, HASH_NULL, HASH_TIGERTREE, HASH_TORRENT, detail::List< FragmentT, ContainerT >::insert(), CFragmentedFile::InvalidateRange(), m_nHashsetBlock, m_nHashsetSuccess, CDownloadBase::m_nSize, m_nTigerBlock, m_nTigerSize, m_nTigerSuccess, CDownloadWithTorrent::m_nTorrentBlock, CDownloadWithTorrent::m_nTorrentSize, CDownloadWithTorrent::m_nTorrentSuccess, m_nVerifyBlock, m_nVerifyCookie, m_nVerifyHash, CDownloadWithFile::m_pFile, m_pHashset, m_pHashsetBlock, m_pTigerBlock, m_pTigerTree, CDownloadWithTorrent::m_pTorrent, CDownloadWithTorrent::m_pTorrentBlock, NULL, CDownloadWithTorrent::OnFinishedTorrentBlock(), CDownloadWithSources::RemoveOverlappingSources(), CDownloadBase::SetModified(), SubtractHelper(), TS_FALSE, and TS_TRUE.

Referenced by ContinueValidation().

CString CDownloadWithTiger::GetAvailableRanges  )  const [virtual]
 

Reimplemented from CDownloadWithFile.

Definition at line 629 of file DownloadWithTiger.cpp.

References CDownloadWithFile::GetAvailableRanges(), and GetNextVerifyRange().

Referenced by CUploadTransferHTTP::RequestPartialFile().

CED2K * CDownloadWithTiger::GetHashset  ) 
 

Definition at line 286 of file DownloadWithTiger.cpp.

References CED2K::IsAvailable(), m_pHashset, and NULL.

BOOL CDownloadWithTiger::GetNextVerifyRange QWORD nOffset,
QWORD nLength,
BOOL &  bSuccess,
int  nHash = HASH_NULL
const
 

Definition at line 98 of file DownloadWithTiger.cpp.

References ED2K_PART_SIZE, HASH_ED2K, HASH_NULL, HASH_TIGERTREE, HASH_TORRENT, m_nHashsetBlock, CDownloadBase::m_nSize, m_nTigerBlock, m_nTigerSize, CDownloadWithTorrent::m_nTorrentBlock, CDownloadWithTorrent::m_nTorrentSize, m_pHashsetBlock, m_pTigerBlock, CDownloadWithTorrent::m_pTorrentBlock, NULL, and TS_TRUE.

Referenced by CFragmentBar::DrawDownload(), and GetAvailableRanges().

CTigerTree * CDownloadWithTiger::GetTigerTree  ) 
 

Definition at line 223 of file DownloadWithTiger.cpp.

References CTigerTree::IsAvailable(), m_pTigerTree, and NULL.

Referenced by CUploadTransferHTTP::RequestPartialFile().

DWORD CDownloadWithTiger::GetValidationCookie  )  const
 

Definition at line 69 of file DownloadWithTiger.cpp.

References m_nVerifyCookie.

QWORD CDownloadWithTiger::GetVerifyLength int  nHash = HASH_NULL  )  const
 

Definition at line 74 of file DownloadWithTiger.cpp.

References ED2K_PART_SIZE, HASH_ED2K, HASH_NULL, HASH_TIGERTREE, HASH_TORRENT, m_nTigerSize, CDownloadWithTorrent::m_nTorrentSize, m_pHashsetBlock, m_pTigerBlock, CDownloadWithTorrent::m_pTorrentBlock, and NULL.

Referenced by CDownloadTransfer::ChunkifyRequest().

BOOL CDownloadWithTiger::IsFullyVerified  ) 
 

Definition at line 163 of file DownloadWithTiger.cpp.

References m_nHashsetBlock, m_nHashsetSuccess, m_nTigerBlock, m_nTigerSuccess, CDownloadWithTorrent::m_nTorrentBlock, and CDownloadWithTorrent::m_nTorrentSuccess.

Referenced by CDownloads::GetSeedCount(), and CDownload::OnMoved().

BOOL CDownloadWithTiger::NeedHashset  )  const
 

Definition at line 231 of file DownloadWithTiger.cpp.

References CED2K::IsAvailable(), CDownloadBase::m_nSize, m_pHashset, and SIZE_UNKNOWN.

Referenced by CDownloadEditDlg::OnLButtonUp(), CDownloadTransferED2K::SendSecondaryRequest(), CEDNeighbour::SendSharedDownload(), CEDNeighbour::SendSharedFiles(), and CQuerySearch::WriteHashesToEDPacket().

BOOL CDownloadWithTiger::NeedTigerTree  )  const
 

Definition at line 174 of file DownloadWithTiger.cpp.

References CTigerTree::IsAvailable(), CDownloadBase::m_nSize, m_pTigerTree, and SIZE_UNKNOWN.

Referenced by CDownloadEditDlg::OnLButtonUp(), and CDownloadTransferHTTP::StartNextFragment().

void CDownloadWithTiger::ResetVerification  )  [virtual]
 

Definition at line 659 of file DownloadWithTiger.cpp.

References CBTInfo::FinishBlockTest(), CED2K::FinishBlockTest(), CTigerTree::FinishBlockTest(), HASH_ED2K, HASH_NULL, HASH_TIGERTREE, HASH_TORRENT, m_nHashsetBlock, m_nHashsetSuccess, m_nTigerBlock, m_nTigerSuccess, CDownloadWithTorrent::m_nTorrentBlock, CDownloadWithTorrent::m_nTorrentSuccess, m_nVerifyBlock, m_nVerifyCookie, m_nVerifyHash, m_pHashset, m_pHashsetBlock, m_pTigerBlock, m_pTigerTree, CDownloadWithTorrent::m_pTorrent, CDownloadWithTorrent::m_pTorrentBlock, NULL, and CDownloadBase::SetModified().

Referenced by ClearVerification(), and CDownloadEditDlg::OnLButtonUp().

void CDownloadWithTiger::RunValidation BOOL  bSeeding  )  [protected]
 

Definition at line 322 of file DownloadWithTiger.cpp.

References ContinueValidation(), Downloads, FindNewValidationBlock(), HASH_ED2K, HASH_NULL, HASH_TIGERTREE, HASH_TORRENT, CDownloads::m_nValidation, m_nVerifyBlock, m_nVerifyHash, CDownloadWithFile::m_pFile, m_pHashsetBlock, m_pTigerBlock, CDownloadWithTorrent::m_pTorrentBlock, CDownloadBase::m_sLocalName, NULL, and CDownloadWithFile::OpenFile().

Referenced by CDownload::OnRun().

void CDownloadWithTiger::Serialize CArchive &  ar,
int  nVersion
[virtual]
 

Reimplemented from CDownloadWithTorrent.

Reimplemented in CDownload, and CDownloadWithExtras.

Definition at line 711 of file DownloadWithTiger.cpp.

References ClearVerification(), CED2K::IsAvailable(), CTigerTree::IsAvailable(), CDownloadBase::m_bBTH, CDownloadBase::m_bED2K, CDownloadBase::m_bSHA1, CDownloadBase::m_bTiger, m_nHashsetBlock, m_nHashsetSuccess, CDownloadBase::m_nSize, m_nTigerBlock, m_nTigerSize, m_nTigerSuccess, m_pHashset, m_pHashsetBlock, m_pTigerBlock, m_pTigerTree, CED2K::Serialize(), CTigerTree::Serialize(), CDownloadWithTorrent::Serialize(), and CTigerTree::SetupParameters().

Referenced by CDownloadWithExtras::Serialize().

BOOL CDownloadWithTiger::SetHashset BYTE *  pSource,
DWORD  nSource
 

Definition at line 236 of file DownloadWithTiger.cpp.

References CED2K::Clear(), ED2K_PART_SIZE, CED2K::FromBytes(), CED2K::FromRoot(), CED2K::GetBlockCount(), CDownloadWithFile::GetDisplayName(), CED2K::GetRoot(), IDS_DOWNLOAD_HASHSET_CORRUPT, IDS_DOWNLOAD_HASHSET_READY, CED2K::IsAvailable(), CDownloadBase::m_bED2K, m_nHashsetBlock, CDownloadBase::m_nSize, CDownloadBase::m_pED2K, m_pHashset, m_pHashsetBlock, CShareazaApp::Message(), MSG_DEFAULT, MSG_ERROR, Neighbours, CNeighboursWithED2K::SendDonkeyDownload(), CDownloadBase::SetModified(), Settings, SIZE_UNKNOWN, CSettings::SmartVolume(), and theApp.

Referenced by CEDPartImporter::ImportFile(), CDownloadTransferED2K::OnHashsetAnswer(), and CDownloadTransferHTTP::ReadTiger().

BOOL CDownloadWithTiger::SetTigerTree BYTE *  pTiger,
DWORD  nTiger
 

Definition at line 179 of file DownloadWithTiger.cpp.

References CTigerTree::Clear(), CTigerTree::FromBytes(), CTigerTree::GetBlockCount(), CTigerTree::GetBlockLength(), CDownloadWithFile::GetDisplayName(), CTigerTree::GetHeight(), CTigerTree::GetRoot(), IDS_DOWNLOAD_TIGER_CORRUPT, IDS_DOWNLOAD_TIGER_MISMATCH, IDS_DOWNLOAD_TIGER_READY, CTigerTree::IsAvailable(), CSettings::Library, CDownloadBase::m_bTiger, CDownloadBase::m_nSize, m_nTigerBlock, m_nTigerSize, CDownloadBase::m_pTiger, m_pTigerBlock, m_pTigerTree, CShareazaApp::Message(), MSG_DEFAULT, MSG_ERROR, CDownloadBase::SetModified(), Settings, SIZE_UNKNOWN, CSettings::SmartVolume(), theApp, and CSettings::sLibrary::TigerHeight.

Referenced by CDownloadTransferHTTP::ReadTiger().

void CDownloadWithTiger::SubtractHelper FF::SimpleFragmentList ppCorrupted,
BYTE *  pBlock,
QWORD  nBlock,
QWORD  nSize
[private]
 

Definition at line 611 of file DownloadWithTiger.cpp.

References detail::List< FragmentT, ContainerT >::empty(), detail::List< FragmentT, ContainerT >::erase(), CDownloadBase::m_nSize, and TS_TRUE.

Referenced by FinishValidation().

BOOL CDownloadWithTiger::ValidationCanFinish  )  const [protected]
 

Definition at line 294 of file DownloadWithTiger.cpp.

References CSettings::Downloads, m_nHashsetBlock, m_nHashsetSuccess, m_nTigerBlock, m_nTigerSuccess, CDownloadWithTorrent::m_nTorrentBlock, CDownloadWithTorrent::m_nTorrentSuccess, m_pHashsetBlock, m_pTigerBlock, CDownloadWithTorrent::m_pTorrentBlock, NULL, Settings, CSettings::sDownloads::VerifyED2K, and CSettings::sDownloads::VerifyTiger.

Referenced by CDownload::OnRun().


Friends And Related Function Documentation

friend class CDownloadTipCtrl [friend]
 

Definition at line 87 of file DownloadWithTiger.h.

friend class CEDClient [friend]
 

Definition at line 86 of file DownloadWithTiger.h.


Member Data Documentation

DWORD CDownloadWithTiger::m_nHashsetBlock [private]
 

Definition at line 49 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ClearVerification(), FindNewValidationBlock(), FinishValidation(), GetNextVerifyRange(), IsFullyVerified(), ResetVerification(), Serialize(), SetHashset(), and ValidationCanFinish().

DWORD CDownloadWithTiger::m_nHashsetSuccess [private]
 

Definition at line 50 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), FinishValidation(), IsFullyVerified(), ResetVerification(), Serialize(), and ValidationCanFinish().

DWORD CDownloadWithTiger::m_nTigerBlock [private]
 

Definition at line 43 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ClearVerification(), FindNewValidationBlock(), FinishValidation(), GetNextVerifyRange(), IsFullyVerified(), ResetVerification(), Serialize(), SetTigerTree(), and ValidationCanFinish().

DWORD CDownloadWithTiger::m_nTigerSize [private]
 

Definition at line 44 of file DownloadWithTiger.h.

Referenced by FindNewValidationBlock(), FinishValidation(), GetNextVerifyRange(), GetVerifyLength(), Serialize(), and SetTigerTree().

DWORD CDownloadWithTiger::m_nTigerSuccess [private]
 

Definition at line 45 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), FinishValidation(), IsFullyVerified(), ResetVerification(), Serialize(), and ValidationCanFinish().

DWORD CDownloadWithTiger::m_nVerifyBlock [private]
 

Definition at line 54 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ContinueValidation(), FindNewValidationBlock(), FinishValidation(), ResetVerification(), and RunValidation().

DWORD CDownloadWithTiger::m_nVerifyCookie [private]
 

Definition at line 52 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ClearVerification(), FinishValidation(), GetValidationCookie(), and ResetVerification().

int CDownloadWithTiger::m_nVerifyHash [private]
 

Definition at line 53 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ContinueValidation(), FindNewValidationBlock(), FinishValidation(), ResetVerification(), and RunValidation().

QWORD CDownloadWithTiger::m_nVerifyLength [private]
 

Definition at line 56 of file DownloadWithTiger.h.

Referenced by ContinueValidation(), and FindNewValidationBlock().

QWORD CDownloadWithTiger::m_nVerifyOffset [private]
 

Definition at line 55 of file DownloadWithTiger.h.

Referenced by ContinueValidation(), and FindNewValidationBlock().

CED2K CDownloadWithTiger::m_pHashset [private]
 

Definition at line 47 of file DownloadWithTiger.h.

Referenced by ClearVerification(), ContinueValidation(), FindNewValidationBlock(), FinishValidation(), GetHashset(), NeedHashset(), ResetVerification(), Serialize(), and SetHashset().

BYTE* CDownloadWithTiger::m_pHashsetBlock [private]
 

Definition at line 48 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ClearVerification(), FindNewValidationBlock(), FinishValidation(), GetNextVerifyRange(), GetVerifyLength(), ResetVerification(), RunValidation(), Serialize(), SetHashset(), ValidationCanFinish(), and ~CDownloadWithTiger().

BYTE* CDownloadWithTiger::m_pTigerBlock [private]
 

Definition at line 42 of file DownloadWithTiger.h.

Referenced by CDownloadWithTiger(), ClearVerification(), FindNewValidationBlock(), FinishValidation(), GetNextVerifyRange(), GetVerifyLength(), ResetVerification(), RunValidation(), Serialize(), SetTigerTree(), ValidationCanFinish(), and ~CDownloadWithTiger().

CTigerTree CDownloadWithTiger::m_pTigerTree [private]
 

Definition at line 41 of file DownloadWithTiger.h.

Referenced by ClearVerification(), ContinueValidation(), FindNewValidationBlock(), FinishValidation(), GetTigerTree(), NeedTigerTree(), ResetVerification(), Serialize(), and SetTigerTree().

DWORD CDownloadWithTiger::m_tVerifyLast [private]
 

Definition at line 57 of file DownloadWithTiger.h.

Referenced by FindNewValidationBlock().


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