mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Added small thing to DHT.
This commit is contained in:
parent
d0b4fa56a3
commit
8379941584
|
@ -123,6 +123,13 @@ int client_in_list(Client_data * list, uint32_t length, uint8_t * client_id, IP_
|
||||||
|
|
||||||
for(i = 0; i < length; ++i)
|
for(i = 0; i < length; ++i)
|
||||||
{
|
{
|
||||||
|
/*If ip_port is assigned to a different client_id replace it*/
|
||||||
|
if(list[i].ip_port.ip.i == ip_port.ip.i &&
|
||||||
|
list[i].ip_port.port == ip_port.port)
|
||||||
|
{
|
||||||
|
memcpy(list[i].client_id, client_id, CLIENT_ID_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
if(memcmp(list[i].client_id, client_id, CLIENT_ID_SIZE) == 0)
|
if(memcmp(list[i].client_id, client_id, CLIENT_ID_SIZE) == 0)
|
||||||
{
|
{
|
||||||
/* Refresh the client timestamp. */
|
/* Refresh the client timestamp. */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user