📄 clientlist.cpp.rej
字号:
***************
*** 21,26 ****
#include "Kademlia/Kademlia/kademlia.h"
#include "Kademlia/routing/contact.h"
#include "Kademlia/net/kademliaudplistener.h"
#include "LastCommonRouteFinder.h"
#include "UploadQueue.h"
#include "DownloadQueue.h"
--- 21,31 ----
#include "Kademlia/Kademlia/kademlia.h"
#include "Kademlia/routing/contact.h"
#include "Kademlia/net/kademliaudplistener.h"
+
+ #include "Kademlia2/Kademlia/kademlia.h" //VeryCD
+ #include "Kademlia2/routing/contact.h"
+ #include "Kademlia2/net/kademliaudplistener.h"
+
#include "LastCommonRouteFinder.h"
#include "UploadQueue.h"
#include "DownloadQueue.h"
***************
*** 563,568 ****
AddClient(pNewClient);
}
void CClientList::RemoveTCP(CUpDownClient* torem){
POSITION pos = RequestTCPList.Find(torem);
if(pos)
--- 568,595 ----
AddClient(pNewClient);
}
+ void CClientList::RequestTCP(Kademlia2::CContact* contact) //VeryCD
+ {
+ uint32 nContactIP = ntohl(contact->getIPAddress());
+ //If eMule already knows this client, abort this.. It could cause conflicts.
+ //Although the odds of this happening is very small, it could still happen.
+ if (FindClientByIP(nContactIP, contact->getTCPPort()))
+ {
+ return;
+ }
+
+ // don't connect ourself
+ if (theApp.serverconnect->GetLocalIP() == nContactIP && thePrefs.GetPort() == contact->getTCPPort())
+ return;
+
+ //Add client to the lists to be processed.
+ CUpDownClient* test = new CUpDownClient(0, contact->getTCPPort(), contact->getIPAddress(), 0, 0, false );
+ test->SetKadPort(contact->getUDPPort());
+ test->SetKadState(KS_QUEUED_FWCHECK);
+ RequestTCPList.AddTail(test);
+ AddClient(test);
+ }
+
void CClientList::RemoveTCP(CUpDownClient* torem){
POSITION pos = RequestTCPList.Find(torem);
if(pos)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -