diff options
-rw-r--r-- | toxcore/Messenger.c | 2 | ||||
-rw-r--r-- | toxcore/net_crypto.c | 2 | ||||
-rw-r--r-- | toxcore/net_crypto.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index bb70a44a..2dd8b82a 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -1488,7 +1488,7 @@ int file_control(Messenger *m, int32_t friendnumber, uint8_t send_receive, uint8 | |||
1488 | } | 1488 | } |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | #define MIN_SLOTS_FREE 4 | 1491 | #define MIN_SLOTS_FREE (CRYPTO_MIN_QUEUE_LENGTH / 2) |
1492 | /* Send file data. | 1492 | /* Send file data. |
1493 | * | 1493 | * |
1494 | * return 0 on success | 1494 | * return 0 on success |
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index dcc32486..8d598469 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -2289,7 +2289,7 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2289 | 2289 | ||
2290 | if (conn->last_packets_left_set == 0) { | 2290 | if (conn->last_packets_left_set == 0) { |
2291 | conn->last_packets_left_set = temp_time; | 2291 | conn->last_packets_left_set = temp_time; |
2292 | conn->packets_left = conn->packet_send_rate; | 2292 | conn->packets_left = CRYPTO_MIN_QUEUE_LENGTH; |
2293 | } else if (((1000.0 / conn->packet_send_rate) + conn->last_packets_left_set) < temp_time) { | 2293 | } else if (((1000.0 / conn->packet_send_rate) + conn->last_packets_left_set) < temp_time) { |
2294 | uint32_t num_packets = conn->packet_send_rate * ((double)(temp_time - conn->last_packets_left_set) / 1000.0) + 0.5; | 2294 | uint32_t num_packets = conn->packet_send_rate * ((double)(temp_time - conn->last_packets_left_set) / 1000.0) + 0.5; |
2295 | 2295 | ||
diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index ee790f24..d30d5a63 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #define CRYPTO_PACKET_MIN_RATE 16.0 | 41 | #define CRYPTO_PACKET_MIN_RATE 16.0 |
42 | 42 | ||
43 | /* Minimum packet queue max length. */ | 43 | /* Minimum packet queue max length. */ |
44 | #define CRYPTO_MIN_QUEUE_LENGTH 8 | 44 | #define CRYPTO_MIN_QUEUE_LENGTH 16 |
45 | 45 | ||
46 | #define MAX_CRYPTO_PACKET_SIZE 1400 | 46 | #define MAX_CRYPTO_PACKET_SIZE 1400 |
47 | 47 | ||