diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-10-26 22:49:43 -0700 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-10-26 22:49:43 -0700 |
commit | 19ddee5582bf6dc3d53cb31944de23277341eab6 (patch) | |
tree | fea3a5b665f7e6022e0491183d8f51ff00412421 /src/or/onion.c | |
parent | 174be15c1a062bb39298418a9c530f73557c4916 (diff) | |
download | tor-19ddee5582bf6dc3d53cb31944de23277341eab6.tar.gz tor-19ddee5582bf6dc3d53cb31944de23277341eab6.zip |
Fix bug 1042.
If your relay can't keep up with the number of incoming create cells, it
would log one warning per failure into your logs. Limit warnings to 1 per
minute.
Diffstat (limited to 'src/or/onion.c')
-rw-r--r-- | src/or/onion.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/or/onion.c b/src/or/onion.c index 58a51aedfe..f8913cd23b 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -58,11 +58,17 @@ onion_pending_add(or_circuit_t *circ, char *onionskin) tor_assert(!ol_tail->next); if (ol_length >= get_options()->MaxOnionsPending) { - log_warn(LD_GENERAL, - "Your computer is too slow to handle this many circuit " - "creation requests! Please consider using the " - "MaxAdvertisedBandwidth config option or choosing a more " - "restricted exit policy."); +#define WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL (60) + static time_t last_warned = 0; + time_t now = time(NULL); + if (last_warned + WARN_TOO_MANY_CIRC_CREATIONS_INTERVAL < now) { + log_warn(LD_GENERAL, + "Your computer is too slow to handle this many circuit " + "creation requests! Please consider using the " + "MaxAdvertisedBandwidth config option or choosing a more " + "restricted exit policy."); + last_warned = now; + } tor_free(tmp); return -1; } |