diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-22 17:21:58 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-22 17:21:58 -0400 |
commit | 83799415846b160e71bcb9f83fc193845140f9b0 (patch) | |
tree | 69bc08245547caa14e0e2089bdb596b8aad2934e | |
parent | d0b4fa56a3f8334cfffce45a9eadfcd8143f7944 (diff) |
Added small thing to DHT.
-rw-r--r-- | core/DHT.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -123,6 +123,13 @@ int client_in_list(Client_data * list, uint32_t length, uint8_t * client_id, IP_ | |||
123 | 123 | ||
124 | for(i = 0; i < length; ++i) | 124 | for(i = 0; i < length; ++i) |
125 | { | 125 | { |
126 | /*If ip_port is assigned to a different client_id replace it*/ | ||
127 | if(list[i].ip_port.ip.i == ip_port.ip.i && | ||
128 | list[i].ip_port.port == ip_port.port) | ||
129 | { | ||
130 | memcpy(list[i].client_id, client_id, CLIENT_ID_SIZE); | ||
131 | } | ||
132 | |||
126 | if(memcmp(list[i].client_id, client_id, CLIENT_ID_SIZE) == 0) | 133 | if(memcmp(list[i].client_id, client_id, CLIENT_ID_SIZE) == 0) |
127 | { | 134 | { |
128 | /* Refresh the client timestamp. */ | 135 | /* Refresh the client timestamp. */ |