From a4ac1497a5ab4fbb13f998c9fffb14c07d4b380a Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 5 Jun 2014 19:16:03 -0400 Subject: Fixed regression that made packet_send_rate increase even when no data was transmitted. --- toxcore/net_crypto.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toxcore/net_crypto.c') diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index d50ac4b6..811dbf1a 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -2298,7 +2298,10 @@ static void send_crypto_packets(Net_Crypto *c) int ret = send_requested_packets(c, i, conn->packets_left); if (ret != -1) { - conn->sending = CONN_SENDING_VALUE; + if (ret != 0) { + conn->sending = CONN_SENDING_VALUE; + } + conn->packets_resent += ret; conn->packets_left -= ret; } -- cgit v1.2.3