mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add a generic rate-limited log mechanism, and use it in a few places
Incidentally fixes bug 1042.
This commit is contained in:
+6
-1
@@ -288,7 +288,12 @@ command_process_create_cell(cell_t *cell, or_connection_t *conn)
|
||||
|
||||
/* hand it off to the cpuworkers, and then return. */
|
||||
if (assign_onionskin_to_cpuworker(NULL, circ, onionskin) < 0) {
|
||||
log_warn(LD_GENERAL,"Failed to hand off onionskin. Closing.");
|
||||
static ratelim_t handoff_warning = RATELIM_INIT(3600);
|
||||
char *m;
|
||||
if ((m = rate_limit_log(&handoff_warning, approx_time()))) {
|
||||
log_warn(LD_GENERAL,"Failed to hand off onionskin. Closing.%s",m);
|
||||
tor_free(m);
|
||||
}
|
||||
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user