]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Limit the number of inflight items to the number of items.
authorcypherpunks <cypherpunks@torproject.org>
Tue, 21 Jul 2015 10:43:03 +0000 (12:43 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 21 Jul 2015 18:02:41 +0000 (14:02 -0400)
src/test/test_workqueue.c

index edefb292c0d32f3efab6b9d58f6111100e0dda4e..24d7ffefa32088743af2fadeb3c9920231fdfb9d 100644 (file)
@@ -353,6 +353,7 @@ main(int argc, char **argv)
       return 1;
     }
   }
+
   if (opt_n_threads < 1 ||
       opt_n_items < 1 || opt_n_inflight < 1 || opt_n_lowwater < 0 ||
       opt_n_cancel > opt_n_inflight || opt_n_inflight > MAX_INFLIGHT ||
@@ -361,6 +362,10 @@ main(int argc, char **argv)
     return 1;
   }
 
+  if (opt_n_inflight > opt_n_items) {
+      opt_n_inflight = opt_n_items;
+  }
+
   init_logging(1);
   crypto_global_init(1, NULL, NULL);
   crypto_seed_rng();