From 0244bd596deaba90bcf9282e1709ea5f25b328ca Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 14 Jul 2014 12:21:13 -0400 Subject: [PATCH] Attempted fix of file transfer issue. Instead of dropping the rate to minimum just half it until it drops to the minimum. --- toxcore/net_crypto.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 7c0dd77b..bb1bbe05 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -2318,8 +2318,12 @@ static void send_crypto_packets(Net_Crypto *c) conn->packets_resent = 0; conn->last_queue_size = queue_size; - if (conn->packet_send_rate < CRYPTO_PACKET_MIN_RATE || !conn->sending || !conn->packets_sent) { + if (!conn->sending || !conn->packets_sent) { conn->rate_increase = 0; + conn->packet_send_rate /= 2; + } + + if (conn->packet_send_rate < CRYPTO_PACKET_MIN_RATE) { conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; }