diff options
author | irungentoo <irungentoo@gmail.com> | 2014-11-21 20:18:29 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-11-21 20:18:29 -0500 |
commit | 6bbb9398558d226711450feea45417bcf3eafe70 (patch) | |
tree | ed946e3fa14ccc4aec0dbdddc481dcd1e2de3e69 /toxcore/onion_announce.c | |
parent | e74225039e08e7be6e60cf7e2f5e279eb0559ce7 (diff) |
Cleaned up packet length types in toxcore.
They are now all uint16_t instead of sometimes being uint32_t.
Replaced some other uint32_t with unsigned ints.
Diffstat (limited to 'toxcore/onion_announce.c')
-rw-r--r-- | toxcore/onion_announce.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index 2b0de595..32442797 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c | |||
@@ -207,7 +207,7 @@ static void generate_ping_id(const Onion_Announce *onion_a, uint64_t time, const | |||
207 | */ | 207 | */ |
208 | static int in_entries(const Onion_Announce *onion_a, const uint8_t *public_key) | 208 | static int in_entries(const Onion_Announce *onion_a, const uint8_t *public_key) |
209 | { | 209 | { |
210 | uint32_t i; | 210 | unsigned int i; |
211 | 211 | ||
212 | for (i = 0; i < ONION_ANNOUNCE_MAX_ENTRIES; ++i) { | 212 | for (i = 0; i < ONION_ANNOUNCE_MAX_ENTRIES; ++i) { |
213 | if (!is_timeout(onion_a->entries[i].time, ONION_ANNOUNCE_TIMEOUT) | 213 | if (!is_timeout(onion_a->entries[i].time, ONION_ANNOUNCE_TIMEOUT) |
@@ -258,7 +258,7 @@ static int add_to_entries(Onion_Announce *onion_a, IP_Port ret_ip_port, const ui | |||
258 | 258 | ||
259 | int pos = in_entries(onion_a, public_key); | 259 | int pos = in_entries(onion_a, public_key); |
260 | 260 | ||
261 | uint32_t i; | 261 | unsigned int i; |
262 | 262 | ||
263 | if (pos == -1) { | 263 | if (pos == -1) { |
264 | for (i = 0; i < ONION_ANNOUNCE_MAX_ENTRIES; ++i) { | 264 | for (i = 0; i < ONION_ANNOUNCE_MAX_ENTRIES; ++i) { |
@@ -286,7 +286,7 @@ static int add_to_entries(Onion_Announce *onion_a, IP_Port ret_ip_port, const ui | |||
286 | return in_entries(onion_a, public_key); | 286 | return in_entries(onion_a, public_key); |
287 | } | 287 | } |
288 | 288 | ||
289 | static int handle_announce_request(void *object, IP_Port source, const uint8_t *packet, uint32_t length) | 289 | static int handle_announce_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length) |
290 | { | 290 | { |
291 | Onion_Announce *onion_a = object; | 291 | Onion_Announce *onion_a = object; |
292 | 292 | ||
@@ -325,8 +325,8 @@ static int handle_announce_request(void *object, IP_Port source, const uint8_t * | |||
325 | 325 | ||
326 | /*Respond with a announce response packet*/ | 326 | /*Respond with a announce response packet*/ |
327 | Node_format nodes_list[MAX_SENT_NODES]; | 327 | Node_format nodes_list[MAX_SENT_NODES]; |
328 | uint32_t num_nodes = get_close_nodes(onion_a->dht, plain + ONION_PING_ID_SIZE, nodes_list, 0, LAN_ip(source.ip) == 0, | 328 | unsigned int num_nodes = get_close_nodes(onion_a->dht, plain + ONION_PING_ID_SIZE, nodes_list, 0, |
329 | 1); | 329 | LAN_ip(source.ip) == 0, 1); |
330 | uint8_t nonce[crypto_box_NONCEBYTES]; | 330 | uint8_t nonce[crypto_box_NONCEBYTES]; |
331 | random_nonce(nonce); | 331 | random_nonce(nonce); |
332 | 332 | ||
@@ -379,7 +379,7 @@ static int handle_announce_request(void *object, IP_Port source, const uint8_t * | |||
379 | return 0; | 379 | return 0; |
380 | } | 380 | } |
381 | 381 | ||
382 | static int handle_data_request(void *object, IP_Port source, const uint8_t *packet, uint32_t length) | 382 | static int handle_data_request(void *object, IP_Port source, const uint8_t *packet, uint16_t length) |
383 | { | 383 | { |
384 | Onion_Announce *onion_a = object; | 384 | Onion_Announce *onion_a = object; |
385 | 385 | ||