Browse Source

Rate-limit "too-many-sockets" messages; they can get needlessly verbose.

svn:r16480
Nick Mathewson 16 years ago
parent
commit
30422b5df1
2 changed files with 5 additions and 1 deletions
  1. 4 0
      ChangeLog
  2. 1 1
      src/or/connection.c

+ 4 - 0
ChangeLog

@@ -18,6 +18,10 @@ Changes in version 0.2.1.5-alpha - 2008-08-??
       when building against recent kernels.  Bugfix on 0.1.2.1-alpha.
     - Add a missing safe_str() call for a debug log message.
 
+  o Minor features
+    - Rate-limit too-many-sockets messages: when they happen, they
+      happen a lot.  Resolves bug 748.
+
 
 Changes in version 0.2.1.4-alpha - 2008-08-04
   o Major bugfixes:

+ 1 - 1
src/or/connection.c

@@ -762,8 +762,8 @@ warn_too_many_conns(void)
 {
 #define WARN_TOO_MANY_CONNS_INTERVAL (6*60*60)
   time_t last_warned = 0, now = time(NULL);
+  int n_conns = get_n_open_sockets();
   if (last_warned + WARN_TOO_MANY_CONNS_INTERVAL < now) {
-    int n_conns = get_n_open_sockets();
     log_warn(LD_NET,"Failing because we have %d connections already. Please "
              "raise your ulimit -n.", n_conns);
     last_warned = now;