Fixed some more possible issues with file transfers/conjestion control.

This commit is contained in:
irungentoo 2014-06-25 15:04:34 -04:00
parent eb2688b715
commit a058a17273
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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