From 461c8f51f5c7165884cb556443ba8950532b46eb Mon Sep 17 00:00:00 2001 From: Pavel Karelin Date: Tue, 15 May 2018 09:57:07 +0300 Subject: Fix the often call of event tox_friend_connection_status Fixes #868 Is made by: 1. Fix enumeration mechanism of Crypto_Connection instances in function send_crypto_packets() (this item solves the main problem); 2. Disruption of correlation between parameters of different dimensions (the parameters MAX_NUM_SENDPACKET_TRIES and UDP_DIRECT_TIMEOUT have different dimensions). --- toxcore/net_crypto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toxcore/net_crypto.h') diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index bd00a3fe..ec55bf6f 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h @@ -62,7 +62,7 @@ #define MAX_NUM_SENDPACKET_TRIES 8 /* The timeout of no received UDP packets before the direct UDP connection is considered dead. */ -#define UDP_DIRECT_TIMEOUT ((MAX_NUM_SENDPACKET_TRIES * CRYPTO_SEND_PACKET_INTERVAL) / 1000) +#define UDP_DIRECT_TIMEOUT 8 #define PACKET_ID_PADDING 0 /* Denotes padding */ #define PACKET_ID_REQUEST 1 /* Used to request unreceived packets */ -- cgit v1.2.3