diff options
-rw-r--r-- | toxcore/net_crypto.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index bd290563..83b8b8cf 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -2226,6 +2226,10 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2226 | uint32_t npackets = num_packets_array(&conn->send_array); | 2226 | uint32_t npackets = num_packets_array(&conn->send_array); |
2227 | double min_speed = 1000.0 * (((double)(total_sent)) / ((double)(CONGESTION_QUEUE_ARRAY_SIZE) * | 2227 | double min_speed = 1000.0 * (((double)(total_sent)) / ((double)(CONGESTION_QUEUE_ARRAY_SIZE) * |
2228 | PACKET_COUNTER_AVERAGE_INTERVAL)); | 2228 | PACKET_COUNTER_AVERAGE_INTERVAL)); |
2229 | |||
2230 | if (min_speed < CRYPTO_PACKET_MIN_RATE) | ||
2231 | min_speed = CRYPTO_PACKET_MIN_RATE; | ||
2232 | |||
2229 | double send_array_ratio = (((double)npackets) / min_speed); | 2233 | double send_array_ratio = (((double)npackets) / min_speed); |
2230 | 2234 | ||
2231 | //TODO: Improve formula? | 2235 | //TODO: Improve formula? |