summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-03-03 20:46:34 -0500
committerirungentoo <irungentoo@gmail.com>2014-03-03 20:46:34 -0500
commita251e71a97d40342bada58d88c2234f3ba25c700 (patch)
treea1d1e042e2e7c6fd492326e7aba4c0bd0f32cf07 /toxcore
parent602c71bc17d4c23f6d0968aa09b9b058bff57862 (diff)
Some small changes/fixes.
Changed some timeouts and made cryptopacket_handle return correctly.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/net_crypto.c4
-rw-r--r--toxcore/onion_client.c4
-rw-r--r--toxcore/onion_client.h3
3 files changed, 6 insertions, 5 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index 5c2691f3..16a6784f 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -376,8 +376,8 @@ static int cryptopacket_handle(void *object, IP_Port source, uint8_t *packet, ui
376 376
377 if (!dht->c->cryptopackethandlers[number].function) return 1; 377 if (!dht->c->cryptopackethandlers[number].function) return 1;
378 378
379 dht->c->cryptopackethandlers[number].function(dht->c->cryptopackethandlers[number].object, source, public_key, data, 379 return dht->c->cryptopackethandlers[number].function(dht->c->cryptopackethandlers[number].object, source, public_key,
380 len); 380 data, len);
381 381
382 } else { /* If request is not for us, try routing it. */ 382 } else { /* If request is not for us, try routing it. */
383 int retval = route_packet(dht, packet + 1, packet, length); 383 int retval = route_packet(dht, packet + 1, packet, length);
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c
index cc147828..64fdae35 100644
--- a/toxcore/onion_client.c
+++ b/toxcore/onion_client.c
@@ -806,7 +806,7 @@ int onion_set_friend_online(Onion_Client *onion_c, int friend_num, uint8_t is_on
806} 806}
807 807
808 808
809#define ANNOUNCE_FRIEND 30 809#define ANNOUNCE_FRIEND ONION_NODE_PING_INTERVAL
810 810
811static void do_friend(Onion_Client *onion_c, uint16_t friendnum) 811static void do_friend(Onion_Client *onion_c, uint16_t friendnum)
812{ 812{
@@ -882,7 +882,7 @@ void oniondata_registerhandler(Onion_Client *onion_c, uint8_t byte, oniondata_ha
882} 882}
883 883
884#define ANNOUNCE_INTERVAL_NOT_ANNOUNCED 7 884#define ANNOUNCE_INTERVAL_NOT_ANNOUNCED 7
885#define ANNOUNCE_INTERVAL_ANNOUNCED 30 885#define ANNOUNCE_INTERVAL_ANNOUNCED ONION_NODE_PING_INTERVAL
886 886
887static void do_announce(Onion_Client *onion_c) 887static void do_announce(Onion_Client *onion_c)
888{ 888{
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h
index ae3e7ea3..684c03cc 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -27,7 +27,8 @@
27#include "onion_announce.h" 27#include "onion_announce.h"
28 28
29#define MAX_ONION_CLIENTS 8 29#define MAX_ONION_CLIENTS 8
30#define ONION_NODE_TIMEOUT 240 30#define ONION_NODE_PING_INTERVAL 30
31#define ONION_NODE_TIMEOUT (ONION_NODE_PING_INTERVAL * 4)
31 32
32/* The interval in seconds at which to tell our friends where we are */ 33/* The interval in seconds at which to tell our friends where we are */
33#define ONION_FAKEID_INTERVAL 30 34#define ONION_FAKEID_INTERVAL 30