mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Increased some timeouts to try to prevent disconnections when
transferring files on wireless networks.
This commit is contained in:
parent
ad20432494
commit
4eecaf3ee6
|
@ -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 -
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user