summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-06-25 15:04:34 -0400
committerirungentoo <irungentoo@gmail.com>2014-06-25 15:04:34 -0400
commita058a1727334b9ae6c16cd47122938846104bb9d (patch)
tree9c173554c2277d12a23f3d7d00c5732589755053 /toxcore
parenteb2688b71548f79d0bc7aa3fda235580ce6810a9 (diff)
Fixed some more possible issues with file transfers/conjestion control.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/Messenger.c2
-rw-r--r--toxcore/net_crypto.c2
-rw-r--r--toxcore/net_crypto.h2
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