diff options
-rw-r--r-- | toxcore/net_crypto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 685ce653..41efc1b1 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -1549,15 +1549,15 @@ static void send_crypto_packets(Net_Crypto *c) | |||
1549 | 1549 | ||
1550 | if ((double)num_packets_array(&conn->send_array) < 0.3 * (conn->packet_send_rate)) { | 1550 | if ((double)num_packets_array(&conn->send_array) < 0.3 * (conn->packet_send_rate)) { |
1551 | conn->packet_send_rate *= 1.2; | 1551 | conn->packet_send_rate *= 1.2; |
1552 | } else if ((double)num_packets_array(&conn->send_array) > 0.5 * (conn->packet_send_rate)) { | 1552 | } else if ((double)num_packets_array(&conn->send_array) > 0.4 * (conn->packet_send_rate)) { |
1553 | conn->packet_send_rate *= 0.8; | 1553 | conn->packet_send_rate *= 0.8; |
1554 | } | 1554 | } |
1555 | 1555 | ||
1556 | if (conn->packet_send_rate < CRYPTO_PACKET_MIN_RATE || !conn->sending) | 1556 | if (conn->packet_send_rate < CRYPTO_PACKET_MIN_RATE || !conn->sending) |
1557 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; | 1557 | conn->packet_send_rate = CRYPTO_PACKET_MIN_RATE; |
1558 | 1558 | ||
1559 | if (conn->packet_send_rate > CRYPTO_PACKET_BUFFER_SIZE * 8) | 1559 | if (conn->packet_send_rate > CRYPTO_PACKET_BUFFER_SIZE * 2) |
1560 | conn->packet_send_rate = CRYPTO_PACKET_BUFFER_SIZE * 8; | 1560 | conn->packet_send_rate = CRYPTO_PACKET_BUFFER_SIZE * 2; |
1561 | 1561 | ||
1562 | } | 1562 | } |
1563 | 1563 | ||