diff options
-rw-r--r-- | toxcore/net_crypto.c | 2 | ||||
-rw-r--r-- | toxcore/net_crypto.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 4d76e659..b045ff8c 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -2130,7 +2130,7 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2130 | double send_array_ratio = (((double)npackets) / min_speed); | 2130 | double send_array_ratio = (((double)npackets) / min_speed); |
2131 | 2131 | ||
2132 | //TODO: Improve formula? | 2132 | //TODO: Improve formula? |
2133 | if (send_array_ratio > 2.0 && CRYPTO_MIN_QUEUE_LENGTH * 3 < npackets) { | 2133 | if (send_array_ratio > 2.0 && CRYPTO_MIN_QUEUE_LENGTH < npackets) { |
2134 | conn->packet_send_rate = min_speed * (1.0 / (send_array_ratio / 2.0)); | 2134 | conn->packet_send_rate = min_speed * (1.0 / (send_array_ratio / 2.0)); |
2135 | } else if (conn->last_congestion_event + CONGESTION_EVENT_TIMEOUT < temp_time) { | 2135 | } else if (conn->last_congestion_event + CONGESTION_EVENT_TIMEOUT < temp_time) { |
2136 | conn->packet_send_rate = min_speed * 1.2; | 2136 | conn->packet_send_rate = min_speed * 1.2; |
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index e5484e1e..9e6ff4b5 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #define CRYPTO_PACKET_BUFFER_SIZE 16384 /* Must be a power of 2 */ | 39 | #define CRYPTO_PACKET_BUFFER_SIZE 16384 /* Must be a power of 2 */ |
40 | 40 | ||
41 | /* Minimum packet rate per second. */ | 41 | /* Minimum packet rate per second. */ |
42 | #define CRYPTO_PACKET_MIN_RATE 8.0 | 42 | #define CRYPTO_PACKET_MIN_RATE 4.0 |
43 | 43 | ||
44 | /* Minimum packet queue max length. */ | 44 | /* Minimum packet queue max length. */ |
45 | #define CRYPTO_MIN_QUEUE_LENGTH 64 | 45 | #define CRYPTO_MIN_QUEUE_LENGTH 64 |