diff options
author | irungentoo <irungentoo@gmail.com> | 2014-09-06 22:14:13 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-09-06 22:14:13 -0400 |
commit | 64ce60c58550c400160438c7c9ccf95e77dc6599 (patch) | |
tree | 5dc51b2f7959df46045db1d37b07e1dc6a9b8763 /toxcore/onion_announce.c | |
parent | df7a627fde43703c7bff833c4e3a419c50859bad (diff) |
This fixes an issue where nodes could stay unannounced for certain
periods of time.
Online nodes should now be able to announce themselves continuously.
Diffstat (limited to 'toxcore/onion_announce.c')
-rw-r--r-- | toxcore/onion_announce.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index baccc95b..b25b6b11 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c | |||
@@ -333,10 +333,14 @@ static int handle_announce_request(void *object, IP_Port source, const uint8_t * | |||
333 | pl[0] = 0; | 333 | pl[0] = 0; |
334 | memcpy(pl + 1, ping_id2, ONION_PING_ID_SIZE); | 334 | memcpy(pl + 1, ping_id2, ONION_PING_ID_SIZE); |
335 | } else { | 335 | } else { |
336 | if (memcmp(onion_a->entries[index].public_key, packet_public_key, crypto_box_PUBLICKEYBYTES) == 0 | 336 | if (memcmp(onion_a->entries[index].public_key, packet_public_key, crypto_box_PUBLICKEYBYTES) == 0) { |
337 | && memcmp(onion_a->entries[index].data_public_key, data_public_key, crypto_box_PUBLICKEYBYTES) != 0) { | 337 | if (memcmp(onion_a->entries[index].data_public_key, data_public_key, crypto_box_PUBLICKEYBYTES) != 0) { |
338 | pl[0] = 0; | 338 | pl[0] = 0; |
339 | memcpy(pl + 1, ping_id2, ONION_PING_ID_SIZE); | 339 | memcpy(pl + 1, ping_id2, ONION_PING_ID_SIZE); |
340 | } else { | ||
341 | pl[0] = 2; | ||
342 | memcpy(pl + 1, ping_id2, ONION_PING_ID_SIZE); | ||
343 | } | ||
340 | } else { | 344 | } else { |
341 | pl[0] = 1; | 345 | pl[0] = 1; |
342 | memcpy(pl + 1, onion_a->entries[index].data_public_key, crypto_box_PUBLICKEYBYTES); | 346 | memcpy(pl + 1, onion_a->entries[index].data_public_key, crypto_box_PUBLICKEYBYTES); |