summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2015-07-21 12:43:03 +0200
committerNick Mathewson <nickm@torproject.org>2015-07-21 14:02:41 -0400
commitc68b3418821ddbe6cfaf94fb8959be52e55f2fe1 (patch)
tree6f25a4cdef4ce8328141fefebcaacb5b88fdff41
parent6e1eaa936a8cd42da24fe7a8b1f698402f3714a7 (diff)
downloadtor-c68b3418821ddbe6cfaf94fb8959be52e55f2fe1.tar.gz
tor-c68b3418821ddbe6cfaf94fb8959be52e55f2fe1.zip
Limit the number of inflight items to the number of items.
-rw-r--r--src/test/test_workqueue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c
index edefb292c0..24d7ffefa3 100644
--- a/src/test/test_workqueue.c
+++ b/src/test/test_workqueue.c
@@ -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();