summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-06-03 20:17:31 -0400
committerirungentoo <irungentoo@gmail.com>2014-06-03 20:17:31 -0400
commitde5a33e8520b99775caee8d4a304703a50ef862e (patch)
tree53eab66e464467827956115b49be41253d8cd835 /toxcore/net_crypto.c
parentedd5ab32154918728b2fb085a51a18266d8d0429 (diff)
Tweaked file transfers a bit.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r--toxcore/net_crypto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index 033f494b..1b78bf1b 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -2142,6 +2142,9 @@ static int udp_handle_packet(void *object, IP_Port source, uint8_t *packet, uint
2142 return 0; 2142 return 0;
2143} 2143}
2144 2144
2145/* Value to set sending variable */
2146#define CONN_SENDING_VALUE 2
2147
2145/* The dT for the average packet recieving rate calculations. 2148/* The dT for the average packet recieving rate calculations.
2146 Also used as the */ 2149 Also used as the */
2147#define PACKET_COUNTER_AVERAGE_INTERVAL 200 2150#define PACKET_COUNTER_AVERAGE_INTERVAL 200
@@ -2291,6 +2294,7 @@ static void send_crypto_packets(Net_Crypto *c)
2291 int ret = send_requested_packets(c, i, conn->packets_left); 2294 int ret = send_requested_packets(c, i, conn->packets_left);
2292 2295
2293 if (ret != -1) { 2296 if (ret != -1) {
2297 conn->sending = CONN_SENDING_VALUE;
2294 conn->packets_resent += ret; 2298 conn->packets_resent += ret;
2295 conn->packets_left -= ret; 2299 conn->packets_left -= ret;
2296 } 2300 }
@@ -2372,7 +2376,7 @@ int64_t write_cryptpacket(Net_Crypto *c, int crypt_connection_id, uint8_t *data,
2372 return -1; 2376 return -1;
2373 2377
2374 --conn->packets_left; 2378 --conn->packets_left;
2375 conn->sending = CRYPTO_MIN_QUEUE_LENGTH; 2379 conn->sending = CONN_SENDING_VALUE;
2376 return ret; 2380 return ret;
2377} 2381}
2378 2382