case KS_QUEUED_FWCHECK: case KS_QUEUED_FWCHECK_UDP: //Another client asked us to try to connect to them to check their firewalled status. cur_client->TryToConnect(true, true); break;
where TryToConnect directly to a LowID client will always fail.
My question is, should we check if the found existing client is known as LowID and failed the test, or we can re-set the ConnectingIP and the TCP port and do the test if the client is not TCP connected with us?
bool CClientList::RequestTCP(Kademlia::CContact* contact, uint8 byConnectOptions) { uint32 nContactIP = ntohl(contact->GetIPAddress()); // don't connect ourself if (theApp.serverconnect->GetLocalIP() == nContactIP && thePrefs.GetPort() == contact->GetTCPPort()) return false; CUpDownClient* pNewClient = FindClientByIP(nContactIP, contact->GetTCPPort()); if (!pNewClient) pNewClient = new CUpDownClient(0, contact->GetTCPPort(), contact->GetIPAddress(), 0, 0, false ); else if (pNewClient->GetKadState() != KS_NONE) return false; // already busy with this client in some way (probably buddy stuff), don't mess with it else if (pNewClient->HasLowID()) //<<- Enig123 return false; //<<- Enig123: the client is known as LowID, TryToConnect to it will always fail
or we can re-set the ID and the TCP port of this client, like initializing a new client from scratch, I am not sure how to do it in the correct way though.
Any thoughts?
Oh, I'm not sure if this should be put into kad specific category, if it does belong to that, please administrators move it there.
Regards,
Enig123
This post has been edited by Enig123: 28 December 2015 - 07:26 PM