mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Speeded up start of file transfers.
This commit is contained in:
parent
0f023d912c
commit
fa007a3b04
|
@ -2389,8 +2389,8 @@ static void send_crypto_packets(Net_Crypto *c)
|
|||
} else if (((1000.0 / conn->packet_send_rate) + conn->last_packets_left_set) < temp_time) {
|
||||
uint32_t num_packets = conn->packet_send_rate * ((double)(temp_time - conn->last_packets_left_set) / 1000.0) + 0.5;
|
||||
|
||||
if (conn->packets_left > num_packets * 2 + CRYPTO_MIN_QUEUE_LENGTH) {
|
||||
conn->packets_left = num_packets * 2 + CRYPTO_MIN_QUEUE_LENGTH;
|
||||
if (conn->packets_left > num_packets * 4 + CRYPTO_MIN_QUEUE_LENGTH) {
|
||||
conn->packets_left = num_packets * 4 + CRYPTO_MIN_QUEUE_LENGTH;
|
||||
} else {
|
||||
conn->packets_left += num_packets;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user