diff options
Diffstat (limited to 'toxcore/onion_client.c')
-rw-r--r-- | toxcore/onion_client.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 97afeb79..8ba1fdc5 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c | |||
@@ -1204,23 +1204,6 @@ static void do_friend(Onion_Client *onion_c, uint16_t friendnum) | |||
1204 | } | 1204 | } |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | /* Timeout before which a peer is considered dead and removed from the DHT search. */ | ||
1208 | #define DEAD_ONION_TIMEOUT (10 * 60) | ||
1209 | |||
1210 | static void cleanup_friend(Onion_Client *onion_c, uint16_t friendnum) | ||
1211 | { | ||
1212 | if (friendnum >= onion_c->num_friends) | ||
1213 | return; | ||
1214 | |||
1215 | if (onion_c->friends_list[friendnum].status == 0) | ||
1216 | return; | ||
1217 | |||
1218 | if (onion_c->friends_list[friendnum].is_fake_clientid && !onion_c->friends_list[friendnum].is_online | ||
1219 | && is_timeout(onion_c->friends_list[friendnum].last_seen, DEAD_ONION_TIMEOUT)) { | ||
1220 | onion_c->friends_list[friendnum].is_fake_clientid = 0; | ||
1221 | //DHT_delfriend(onion_c->dht, onion_c->friends_list[friendnum].fake_client_id, 0); | ||
1222 | } | ||
1223 | } | ||
1224 | 1207 | ||
1225 | /* Function to call when onion data packet with contents beginning with byte is received. */ | 1208 | /* Function to call when onion data packet with contents beginning with byte is received. */ |
1226 | void oniondata_registerhandler(Onion_Client *onion_c, uint8_t byte, oniondata_handler_callback cb, void *object) | 1209 | void oniondata_registerhandler(Onion_Client *onion_c, uint8_t byte, oniondata_handler_callback cb, void *object) |
@@ -1293,7 +1276,6 @@ void do_onion_client(Onion_Client *onion_c) | |||
1293 | if (onion_isconnected(onion_c)) { | 1276 | if (onion_isconnected(onion_c)) { |
1294 | for (i = 0; i < onion_c->num_friends; ++i) { | 1277 | for (i = 0; i < onion_c->num_friends; ++i) { |
1295 | do_friend(onion_c, i); | 1278 | do_friend(onion_c, i); |
1296 | cleanup_friend(onion_c, i); | ||
1297 | } | 1279 | } |
1298 | } | 1280 | } |
1299 | 1281 | ||