|
@@ -309,6 +309,16 @@ 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);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ * burst value */
|
|
|
+ tor_assert_nonfatal(new_circuit_bucket_count <= dos_cc_circuit_burst);
|
|
|
+
|
|
|
+ * is decreasing it to a newly configured, lower burst value. We allow the
|
|
|
+ * bucket to stay the same size, in case the circuit rate is zero. */
|
|
|
+ tor_assert_nonfatal(new_circuit_bucket_count >= stats->circuit_bucket ||
|
|
|
+ new_circuit_bucket_count == dos_cc_circuit_burst);
|
|
|
+
|
|
|
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,
|