diff options
author | irungentoo <irungentoo@gmail.com> | 2015-01-17 21:27:38 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-01-17 21:27:38 -0500 |
commit | 6e0b807f09dd3dc8eba452678058904c5fff2d76 (patch) | |
tree | 3f72e560f4a38e9d1b6e07c2736474b953a3c834 /toxcore | |
parent | a8bf060815f775849853ad1c7e1dcd16dd2e0388 (diff) |
Attempted fix of Tox disconnecting during file transfers by tweaking
some congestion control numbers.
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/net_crypto.c | 4 | ||||
-rw-r--r-- | toxcore/net_crypto.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 112931ad..54a53501 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -2412,7 +2412,7 @@ static int udp_handle_packet(void *object, IP_Port source, const uint8_t *packet | |||
2412 | 2412 | ||
2413 | /* The dT for the average packet receiving rate calculations. | 2413 | /* The dT for the average packet receiving rate calculations. |
2414 | Also used as the */ | 2414 | Also used as the */ |
2415 | #define PACKET_COUNTER_AVERAGE_INTERVAL 100 | 2415 | #define PACKET_COUNTER_AVERAGE_INTERVAL 50 |
2416 | 2416 | ||
2417 | /* Ratio of recv queue size / recv packet rate (in seconds) times | 2417 | /* Ratio of recv queue size / recv packet rate (in seconds) times |
2418 | * the number of ms between request packets to send at that ratio | 2418 | * the number of ms between request packets to send at that ratio |
@@ -2495,7 +2495,7 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2495 | double min_speed = 1000.0 * (((double)(total_sent)) / ((double)(CONGESTION_QUEUE_ARRAY_SIZE) * | 2495 | double min_speed = 1000.0 * (((double)(total_sent)) / ((double)(CONGESTION_QUEUE_ARRAY_SIZE) * |
2496 | PACKET_COUNTER_AVERAGE_INTERVAL)); | 2496 | PACKET_COUNTER_AVERAGE_INTERVAL)); |
2497 | 2497 | ||
2498 | conn->packet_send_rate = min_speed * 1.3; | 2498 | conn->packet_send_rate = min_speed * 1.2; |
2499 | 2499 | ||
2500 | if (conn->packet_send_rate < CRYPTO_PACKET_MIN_RATE) { | 2500 | if (conn->packet_send_rate < CRYPTO_PACKET_MIN_RATE) { |
2501 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; | 2501 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; |
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index 9d699340..7e59475e 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -86,7 +86,7 @@ | |||
86 | 86 | ||
87 | /* Base current transfer speed on last CONGESTION_QUEUE_ARRAY_SIZE number of points taken | 87 | /* Base current transfer speed on last CONGESTION_QUEUE_ARRAY_SIZE number of points taken |
88 | at the dT defined in net_crypto.c */ | 88 | at the dT defined in net_crypto.c */ |
89 | #define CONGESTION_QUEUE_ARRAY_SIZE 8 | 89 | #define CONGESTION_QUEUE_ARRAY_SIZE 24 |
90 | 90 | ||
91 | typedef struct { | 91 | typedef struct { |
92 | uint64_t time; | 92 | uint64_t time; |