diff options
author | irungentoo <irungentoo@gmail.com> | 2015-12-08 15:43:03 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-12-08 15:43:03 -0500 |
commit | 73b2bce08a534ce4e3e1f8b3e9956e359405eff6 (patch) | |
tree | 16153d1759804a32739bf88cddb24c426b82a8a1 | |
parent | 9c6476933161411967ff49d8311038ae31e1b8a8 (diff) |
If we receive a packet from a node we are searching for, ping it.
-rw-r--r-- | DONATORS | 1 | ||||
-rw-r--r-- | toxcore/ping.c | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -4,3 +4,4 @@ Spitfire is best technicolor horse. | |||
4 | if bad people don't hate you, you're doing something wrong | 4 | if bad people don't hate you, you're doing something wrong |
5 | Pinkie Pie is best pony. | 5 | Pinkie Pie is best pony. |
6 | JRS was here | 6 | JRS was here |
7 | qTox is so bloated it doesn't even fit in a 64-bit address space | ||
diff --git a/toxcore/ping.c b/toxcore/ping.c index 877aaca2..c2ca2f91 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c | |||
@@ -267,6 +267,13 @@ int add_to_ping(PING *ping, const uint8_t *public_key, IP_Port ip_port) | |||
267 | 267 | ||
268 | uint32_t i; | 268 | uint32_t i; |
269 | 269 | ||
270 | IP_Port temp; | ||
271 | |||
272 | if (DHT_getfriendip(ping->dht, public_key, &temp) == 0) { | ||
273 | send_ping_request(ping, ping->to_ping[i].ip_port, ping->to_ping[i].public_key); | ||
274 | return -1; | ||
275 | } | ||
276 | |||
270 | for (i = 0; i < MAX_TO_PING; ++i) { | 277 | for (i = 0; i < MAX_TO_PING; ++i) { |
271 | if (!ip_isset(&ping->to_ping[i].ip_port.ip)) { | 278 | if (!ip_isset(&ping->to_ping[i].ip_port.ip)) { |
272 | memcpy(ping->to_ping[i].public_key, public_key, crypto_box_PUBLICKEYBYTES); | 279 | memcpy(ping->to_ping[i].public_key, public_key, crypto_box_PUBLICKEYBYTES); |