summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-10-11 10:08:25 +0100
committerFrediano Ziglio <fziglio@redhat.com>2016-10-11 10:08:38 +0100
commit7f3912b19cbc8a3865d5d24cde179af76d324a72 (patch)
treec917cf3e78ca95c39b571149e4fdf89888917a81
parent1cc30835b99c01d4925c441e339cdfb955b9fde1 (diff)
Avoid bytes_from_first_read to be set again to 0 while transfering
This could potentially sligthly change the speed while transfering data. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--tun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tun.c b/tun.c
index b833b70..7a697b7 100644
--- a/tun.c
+++ b/tun.c
@@ -580,7 +580,7 @@ handle_tun(void)
/* reduce values avoiding possible overflows and
* increasing precision (due to floating point
* numbers) */
- while (curr_time >= flow->first_received_at + 1000000u && flow->bytes_from_first_read >= rate_bytes) {
+ while (curr_time >= flow->first_received_at + 1000000u && flow->bytes_from_first_read > rate_bytes) {
flow->first_received_at += 1000000u;
flow->bytes_from_first_read -= rate_bytes;
}