From 9a466bb6d5d2f7e700ca18d78faca0b1a39e3be4 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Wed, 23 Sep 2009 13:12:43 +0200 Subject: [PATCH] Upstream tarball 9825 --- .svn-revision | 2 +- src/BaseClient.cpp | 6 +++--- src/PartFile.cpp | 6 +++--- src/amule.cpp | 18 +++++++++--------- src/amule.h | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.svn-revision b/.svn-revision index 64df7aa2..06d91dc4 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -9824 +9825 diff --git a/src/BaseClient.cpp b/src/BaseClient.cpp index e7a976e3..06562086 100644 --- a/src/BaseClient.cpp +++ b/src/BaseClient.cpp @@ -1417,7 +1417,7 @@ bool CUpDownClient::TryToConnect(bool bIgnoreMaxCon) } if (HasLowID()) { - if (!theApp->DoCallback(this)) { + if (!theApp->CanDoCallback(this)) { //We cannot do a callback! if (GetDownloadState() == DS_CONNECTING) { SetDownloadState(DS_LOWTOLOWIP); @@ -1435,7 +1435,7 @@ bool CUpDownClient::TryToConnect(bool bIgnoreMaxCon) } //We already know we are not firewalled here as the above condition already detected LowID->LowID and returned. - //If ANYTHING changes with the "if(!theApp->DoCallback(this))" above that will let you fall through + //If ANYTHING changes with the "if(!theApp->CanDoCallback(this))" above that will let you fall through //with the condition that the source is firewalled and we are firewalled, we must //recheck it before the this check.. if (HasValidBuddyID() && !GetBuddyIP() && !GetBuddyPort() && !theApp->serverconnect->IsLocalServer(GetServerIP(), GetServerPort()) @@ -1470,7 +1470,7 @@ bool CUpDownClient::TryToConnect(bool bIgnoreMaxCon) } // a direct callback is possible - since no other parties are involved and only one additional packet overhead // is used we basically handle it like a normal connection try, no restrictions apply - // we already check above with !theApp->DoCallback(this) if any callback is possible at all + // we already check above with !theApp->CanDoCallback(this) if any callback is possible at all m_dwDirectCallbackTimeout = ::GetTickCount() + SEC2MS(45); theApp->clientlist->AddDirectCallbackClient(this); // TODO LOGREMOVE diff --git a/src/PartFile.cpp b/src/PartFile.cpp index b07275c6..fb213a9c 100644 --- a/src/PartFile.cpp +++ b/src/PartFile.cpp @@ -1404,13 +1404,13 @@ uint32 CPartFile::Process(uint32 reducedownload/*in percent*/,uint8 m_icounter) break; } case DS_LOWTOLOWIP: { - if ( cur_src->HasLowID() && !theApp->DoCallback( cur_src ) ) { + if (cur_src->HasLowID() && !theApp->CanDoCallback(cur_src)) { // If we are almost maxed on sources, // slowly remove these client to see // if we can find a better source. - if( ((dwCurTick - lastpurgetime) > 30000) && + if (((dwCurTick - lastpurgetime) > 30000) && (GetSourceCount() >= (thePrefs::GetMaxSourcePerFile()*.8))) { - RemoveSource( cur_src ); + RemoveSource(cur_src); lastpurgetime = dwCurTick; break; } diff --git a/src/amule.cpp b/src/amule.cpp index f0f56280..cf731417 100644 --- a/src/amule.cpp +++ b/src/amule.cpp @@ -2038,16 +2038,16 @@ uint32 CamuleApp::GetBuddyPort() const return clientlist->GetBuddy()->GetUDPPort(); } -bool CamuleApp::DoCallback( CUpDownClient *client ) +bool CamuleApp::CanDoCallback(CUpDownClient *client) { - if(Kademlia::CKademlia::IsConnected()) { - if(IsConnectedED2K()) { - if(serverconnect->IsLowID()) { - if(Kademlia::CKademlia::IsFirewalled()) { + if (Kademlia::CKademlia::IsConnected()) { + if (IsConnectedED2K()) { + if (serverconnect->IsLowID()) { + if (Kademlia::CKademlia::IsFirewalled()) { //Both Connected - Both Firewalled return false; } else { - if(client->GetServerIP() == theApp->serverconnect->GetCurrentServer()->GetIP() && + if (client->GetServerIP() == theApp->serverconnect->GetCurrentServer()->GetIP() && client->GetServerPort() == theApp->serverconnect->GetCurrentServer()->GetPort()) { // Both Connected - Server lowID, Kad Open - Client on same server // We prevent a callback to the server as this breaks the protocol @@ -2063,7 +2063,7 @@ bool CamuleApp::DoCallback( CUpDownClient *client ) return true; } } else { - if(Kademlia::CKademlia::IsFirewalled()) { + if (Kademlia::CKademlia::IsFirewalled()) { //Only Kad Connected - Kad Firewalled return false; } else { @@ -2072,8 +2072,8 @@ bool CamuleApp::DoCallback( CUpDownClient *client ) } } } else { - if( IsConnectedED2K() ) { - if( serverconnect->IsLowID() ) { + if (IsConnectedED2K()) { + if (serverconnect->IsLowID()) { //Only Server Connected - Server LowID return false; } else { diff --git a/src/amule.h b/src/amule.h index f9dedd01..18c8cd93 100644 --- a/src/amule.h +++ b/src/amule.h @@ -166,7 +166,7 @@ public: uint32 GetBuddyPort() const; // Check if we should callback this client - bool DoCallback( CUpDownClient *client ); + bool CanDoCallback(CUpDownClient *client); // URL functions wxString CreateMagnetLink(const CAbstractFile *f); -- 2.11.4.GIT