diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-08-18 15:55:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-08-18 15:55:49 -0400 |
commit | ba9c1275c4b2325aed6a2fe2cc236794dab11052 (patch) | |
tree | 27be4318e4d65bff4e312a5476bcc184d69aa6cf /src/or/command.c | |
parent | d72edc4b78f0104823d156e605259d9d41e6f54c (diff) | |
download | tor-ba9c1275c4b2325aed6a2fe2cc236794dab11052.tar.gz tor-ba9c1275c4b2325aed6a2fe2cc236794dab11052.zip |
Add a generic rate-limited log mechanism, and use it in a few places
Incidentally fixes bug 1042.
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/command.c b/src/or/command.c index 0460e25c25..ad8abfe5c9 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -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; } |