mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed some more possible issues with file transfers/conjestion control.
This commit is contained in:
parent
eb2688b715
commit
a058a17273
|
@ -1488,7 +1488,7 @@ int file_control(Messenger *m, int32_t friendnumber, uint8_t send_receive, uint8
|
|||
}
|
||||
}
|
||||
|
||||
#define MIN_SLOTS_FREE 4
|
||||
#define MIN_SLOTS_FREE (CRYPTO_MIN_QUEUE_LENGTH / 2)
|
||||
/* Send file data.
|
||||
*
|
||||
* return 0 on success
|
||||
|
|
|
@ -2289,7 +2289,7 @@ static void send_crypto_packets(Net_Crypto *c)
|
|||
|
||||
if (conn->last_packets_left_set == 0) {
|
||||
conn->last_packets_left_set = temp_time;
|
||||
conn->packets_left = conn->packet_send_rate;
|
||||
conn->packets_left = CRYPTO_MIN_QUEUE_LENGTH;
|
||||
} 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;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#define CRYPTO_PACKET_MIN_RATE 16.0
|
||||
|
||||
/* Minimum packet queue max length. */
|
||||
#define CRYPTO_MIN_QUEUE_LENGTH 8
|
||||
#define CRYPTO_MIN_QUEUE_LENGTH 16
|
||||
|
||||
#define MAX_CRYPTO_PACKET_SIZE 1400
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user