diff options
author | irungentoo <irungentoo@gmail.com> | 2015-11-21 10:05:39 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-11-21 10:05:39 -0500 |
commit | 25843bf141cedffefbf888034d6b50fbcba52319 (patch) | |
tree | d7dca6c694f8af4f7a07609c143798d4ed60162e /toxcore/net_crypto.c | |
parent | 608ee07c9634d7fa9e90958c6948c1e012434c81 (diff) |
More file transfer improvements.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r-- | toxcore/net_crypto.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index f29183ca..f08866aa 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -2235,7 +2235,12 @@ static void send_crypto_packets(Net_Crypto *c) | |||
2235 | total_resent += conn->last_num_packets_resent[ind]; | 2235 | total_resent += conn->last_num_packets_resent[ind]; |
2236 | } | 2236 | } |
2237 | 2237 | ||
2238 | total_sent -= sum; | 2238 | if (sum > 0) { |
2239 | total_sent -= sum; | ||
2240 | } else { | ||
2241 | if (total_resent > -sum) | ||
2242 | total_resent = -sum; | ||
2243 | } | ||
2239 | 2244 | ||
2240 | /* if queue is too big only allow resending packets. */ | 2245 | /* if queue is too big only allow resending packets. */ |
2241 | uint32_t npackets = num_packets_array(&conn->send_array); | 2246 | uint32_t npackets = num_packets_array(&conn->send_array); |