Skip to content

Commit

Permalink
Speeded up start of file transfers.
Browse files Browse the repository at this point in the history
  • Loading branch information
irungentoo committed Aug 30, 2014
1 parent 0f023d9 commit fa007a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toxcore/net_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fa007a3

Please sign in to comment.