summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-02-05 11:38:58 -0500
committerNick Mathewson <nickm@torproject.org>2018-02-05 11:38:58 -0500
commitf0d7905bc9f20ecee43da3db369073ffb73b4997 (patch)
tree3e2d6ae0c0b791d66fc6cb9e1447f3a177168d25 /src
parent953c769a867415f81dc016f30575dee6c0b2cb43 (diff)
parent78d6cb58707ff46464c591e45d81e83388427e2c (diff)
downloadtor-f0d7905bc9f20ecee43da3db369073ffb73b4997.tar.gz
tor-f0d7905bc9f20ecee43da3db369073ffb73b4997.zip
Merge remote-tracking branch 'dgoulet/ticket24902_029_05'
Diffstat (limited to 'src')
-rw-r--r--src/or/dos.c2
-rw-r--r--src/test/test_dos.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/or/dos.c b/src/or/dos.c
index c221e5ecdf..88f1351a3f 100644
--- a/src/or/dos.c
+++ b/src/or/dos.c
@@ -308,8 +308,6 @@ cc_stats_refill_bucket(cc_client_stats_t *stats, const tor_addr_t *addr)
new_circuit_bucket_count = MIN(stats->circuit_bucket + (uint32_t)num_token,
dos_cc_circuit_burst);
}
- /* This function is not allowed to make the bucket count smaller */
- tor_assert_nonfatal(new_circuit_bucket_count >= stats->circuit_bucket);
log_debug(LD_DOS, "DoS address %s has its circuit bucket value: %" PRIu32
". Filling it to %" PRIu32 ". Circuit rate is %" PRIu64
". Elapsed time is %" PRIi64,
diff --git a/src/test/test_dos.c b/src/test/test_dos.c
index 9a10a2084a..6db98b9ed3 100644
--- a/src/test/test_dos.c
+++ b/src/test/test_dos.c
@@ -179,8 +179,8 @@ test_dos_bucket_refill(void *arg)
uint64_t circ_rate = get_circuit_rate_per_second();
/* Check that the circuit rate is a positive number and smaller than the max
* circuit count */
- tt_int_op(circ_rate, OP_GT, 1);
- tt_int_op(circ_rate, OP_LT, max_circuit_count);
+ tt_u64_op(circ_rate, OP_GT, 1);
+ tt_u64_op(circ_rate, OP_LT, max_circuit_count);
/* Register this client */
geoip_note_client_seen(GEOIP_CLIENT_CONNECT, addr, NULL, now);