Updated docs.

Fixed possible issue in last commit.
This commit is contained in:
irungentoo 2014-09-07 09:04:53 -04:00
parent 64ce60c585
commit 9ac8a5fe62
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
3 changed files with 4 additions and 3 deletions

View File

@ -117,8 +117,9 @@ Data sent to us:
announce response packet: announce response packet:
[uint8_t packet id (132)][data to send back in response(fixed size)][nonce] [uint8_t packet id (132)][data to send back in response(fixed size)][nonce]
encrypted with the DHT private key of Node D, the public key in the request and the nonce:[[uint8_t is_stored] encrypted with the DHT private key of Node D, the public key in the request and the nonce:[[uint8_t is_stored]
[(32 bytes) ping_id if is_stored is 0, public key that must be used to send data packets if is_stored is not 0][Node_Format * (maximum of 8)]] [(32 bytes) ping_id if is_stored is 0 or 2, public key that must be used to send data packets if is_stored is 1][Node_Format * (maximum of 8)]]
(if the is_stored is not 0, it means the information to reach the client id we are searching for is stored on this node) (if the is_stored is not 0, it means the information to reach the client id we are searching for is stored on this node)
is_stored is 2 as a response to a peer trying to announce himself to tell the peer that he is currently annouced successfully.
data to route response packet: data to route response packet:
[uint8_t packet id (134)][nonce][temporary just generated public key] [uint8_t packet id (134)][nonce][temporary just generated public key]

View File

@ -25,7 +25,7 @@
#include "onion.h" #include "onion.h"
#define ONION_ANNOUNCE_MAX_ENTRIES 48 #define ONION_ANNOUNCE_MAX_ENTRIES 64
#define ONION_ANNOUNCE_TIMEOUT 300 #define ONION_ANNOUNCE_TIMEOUT 300
#define ONION_PING_ID_SIZE crypto_hash_sha256_BYTES #define ONION_PING_ID_SIZE crypto_hash_sha256_BYTES

View File

@ -403,7 +403,7 @@ static int client_add_to_list(Onion_Client *onion_c, uint32_t num, const uint8_t
} }
} else { } else {
if (is_stored == 2) if (is_stored >= 2)
return -1; return -1;
list_nodes = onion_c->friends_list[num - 1].clients_list; list_nodes = onion_c->friends_list[num - 1].clients_list;