[or-cvs] [tor/master] Fix bug 1042.

arma at seul.org arma at seul.org
Tue Oct 27 06:02:48 UTC 2009


Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Mon, 26 Oct 2009 22:49:43 -0700
Subject: Fix bug 1042.
Commit: 19ddee5582bf6dc3d53cb31944de23277341eab6

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.
---
 ChangeLog      |    3 +++
 src/or/onion.c |   16 +++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f2d282f..5eb74f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,9 @@ Changes in version 0.2.2.6-alpha - 2009-10-??
       nobody will vote about "Running", and clients will get a consensus
       with no usable relays. Instead, authorities refuse to build a
       consensus if this happens. Bugfix on 0.2.0.10-alpha; fixes bug 1066.
+    - 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. Bugfix on 0.0.2pre10; fixes bug 1042.
 
 
 Changes in version 0.2.2.5-alpha - 2009-10-11
diff --git a/src/or/onion.c b/src/or/onion.c
index 58a51ae..f8913cd 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;
   }
-- 
1.5.6.5



More information about the tor-commits mailing list