[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r8227: fix a log level -- err is for things that kill tor, warn is (tor/trunk/src/or)



Author: arma
Date: 2006-08-26 00:48:50 -0400 (Sat, 26 Aug 2006)
New Revision: 8227

Modified:
   tor/trunk/src/or/config.c
Log:
fix a log level -- err is for things that kill tor, warn is for
things that tor can recover from.

also, avoid situations where people who don't read their logs
accumulate ten thousand useless files in their datadir.


Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2006-08-25 21:16:22 UTC (rev 8226)
+++ tor/trunk/src/or/config.c	2006-08-26 04:48:50 UTC (rev 8227)
@@ -3822,21 +3822,21 @@
   }
 
   if (badstate && !contents) {
-    log_err(LD_BUG, "Uh oh.  We couldn't even validate our own default state. "
-            "This is a bug in Tor.");
+    log_warn(LD_BUG, "Uh oh.  We couldn't even validate our own default state."
+             " This is a bug in Tor.");
     goto done;
   } else if (badstate && contents) {
     int i;
     file_status_t status;
     size_t len = strlen(fname)+16;
     char *fname2 = tor_malloc(len);
-    for (i = 0; i < 10000; ++i) {
+    for (i = 0; i < 100; ++i) {
       tor_snprintf(fname2, len, "%s.%d", fname, i);
       status = file_status(fname2);
       if (status == FN_NOENT)
         break;
     }
-    if (i == 10000) {
+    if (i == 100) {
       log_warn(LD_BUG, "Unable to parse state in \"%s\"; too many saved bad "
                "state files to move aside. Discarding the old state file.",
                fname);