Fixed some possible issues.

This commit is contained in:
irungentoo 2014-02-15 21:03:24 -05:00
parent 5408e3e553
commit 9b61edbb07
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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;