mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed some possible issues.
This commit is contained in:
parent
5408e3e553
commit
9b61edbb07
|
@ -207,7 +207,7 @@ static int add_to_entries(Onion_Announce *onion_a, IP_Port ret_ip_port, uint8_t
|
|||
|
||||
memcpy(cmp_public_key, onion_a->dht->self_public_key, crypto_box_PUBLICKEYBYTES);
|
||||
qsort(onion_a->entries, ONION_ANNOUNCE_MAX_ENTRIES, sizeof(Onion_Announce_Entry), cmp_entry);
|
||||
return pos;
|
||||
return in_entries(onion_a, public_key);
|
||||
}
|
||||
|
||||
static int handle_announce_request(void *object, IP_Port source, uint8_t *packet, uint32_t length)
|
||||
|
|
|
@ -174,6 +174,11 @@ static int client_add_to_list(Onion_Client *onion_c, uint32_t num, uint8_t *publ
|
|||
if (num == 0) {
|
||||
list_nodes = onion_c->clients_announce_list;
|
||||
reference_id = onion_c->dht->c->self_public_key;
|
||||
|
||||
if (is_stored && memcmp(pingid_or_key, onion_c->temp_public_key, crypto_box_PUBLICKEYBYTES) != 0) {
|
||||
is_stored = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
list_nodes = onion_c->friends_list[num - 1].clients_list;
|
||||
reference_id = onion_c->friends_list[num - 1].real_client_id;
|
||||
|
|
Loading…
Reference in New Issue
Block a user