Increased some timeouts to try to prevent disconnections when

transferring files on wireless networks.
This commit is contained in:
irungentoo
2014-06-02 19:35:49 -04:00
parent ad20432494
commit 4eecaf3ee6
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ enum {
#define FRIEND_SHARE_RELAYS_INTERVAL (5 * 60)
/* If no packets are received from friend in this time interval, kill the connection. */
#define FRIEND_CONNECTION_TIMEOUT (FRIEND_PING_INTERVAL * 2)
#define FRIEND_CONNECTION_TIMEOUT (FRIEND_PING_INTERVAL * 3)
/* USERSTATUS -
+1 -1
View File
@@ -2427,7 +2427,7 @@ unsigned int crypto_connection_status(Net_Crypto *c, int crypt_connection_id, ui
*direct_connected = 0;
if ((CRYPTO_SEND_PACKET_INTERVAL * MAX_NUM_SENDPACKET_TRIES + conn->direct_lastrecv_time) > current_time_monotonic())
if ((UDP_DIRECT_TIMEOUT + conn->direct_lastrecv_time) > current_time_monotonic())
*direct_connected = 1;
return conn->status;
+3
View File
@@ -55,6 +55,9 @@
before giving up. */
#define MAX_NUM_SENDPACKET_TRIES 8
/* The timeout of no recieved UDP packets before the direct UDP connection is considered dead. */
#define UDP_DIRECT_TIMEOUT (MAX_NUM_SENDPACKET_TRIES * CRYPTO_SEND_PACKET_INTERVAL * 2)
#define PACKET_ID_PADDING 0
#define PACKET_ID_REQUEST 1
#define PACKET_ID_KILL 2