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

[or-cvs] r8542: Differentiate more duplicated log entries (in tor/trunk: . doc src/common src/or src/tools)



Author: nickm
Date: 2006-09-29 18:33:40 -0400 (Fri, 29 Sep 2006)
New Revision: 8542

Modified:
   tor/trunk/
   tor/trunk/doc/TODO
   tor/trunk/src/common/compat.c
   tor/trunk/src/common/crypto.c
   tor/trunk/src/common/util.c
   tor/trunk/src/or/config.c
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/control.c
   tor/trunk/src/or/cpuworker.c
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dns.c
   tor/trunk/src/or/hibernate.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/router.c
   tor/trunk/src/or/routerparse.c
   tor/trunk/src/tools/tor-resolve.c
Log:
 r9025@Kushana:  nickm | 2006-09-29 18:33:13 -0400
 Differentiate more duplicated log entries



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9025] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/doc/TODO	2006-09-29 22:33:40 UTC (rev 8542)
@@ -298,6 +298,8 @@
       - Implement
 
 Minor items for 0.1.2.x as time permits:
+  - even if your torrc lists yourself in your myfamily line, don't list it in
+    the descriptor.
   - Flesh out options_description array in src/or/config.c
   - Don't let 'newnym' be triggered more often than every n seconds.
   - change log_fn() to log() on notice/warn/err logs where we can.

Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/common/compat.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -652,12 +652,13 @@
     }
 
     if (setgid(gr->gr_gid) != 0) {
-      log_warn(LD_GENERAL,"Error setting GID: %s", strerror(errno));
+      log_warn(LD_GENERAL,"Error setting to configured GID: %s",
+               strerror(errno));
       return -1;
     }
   } else if (user) {
     if (setgid(pw->pw_gid) != 0) {
-      log_warn(LD_GENERAL,"Error setting GID: %s", strerror(errno));
+      log_warn(LD_GENERAL,"Error setting to user GID: %s", strerror(errno));
       return -1;
     }
   }

Modified: tor/trunk/src/common/crypto.c
===================================================================
--- tor/trunk/src/common/crypto.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/common/crypto.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -734,7 +734,7 @@
   tor_assert(sig);
 
   if (crypto_digest(digest,data,datalen)<0) {
-    log_warn(LD_CRYPTO, "couldn't compute digest");
+    log_warn(LD_BUG, "couldn't compute digest");
     return -1;
   }
   r = crypto_pk_public_checksig(env,buf,sig,siglen);

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/common/util.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -907,7 +907,7 @@
   }
   if (m<0) {
     char *esc = esc_for_log(buf);
-    log_warn(LD_GENERAL, "Got invalid RFC1123 time %s", esc);
+    log_warn(LD_GENERAL, "Got invalid RFC1123 time %s: No such month", esc);
     tor_free(esc);
     return -1;
   }
@@ -958,17 +958,17 @@
   struct tm st_tm;
 #ifdef HAVE_STRPTIME
   if (!strptime(cp, "%Y-%m-%d %H:%M:%S", &st_tm)) {
-    log_warn(LD_GENERAL, "Published time was unparseable"); return -1;
+    log_warn(LD_GENERAL, "ISO time was unparseable by strptime"); return -1;
   }
 #else
   unsigned int year=0, month=0, day=0, hour=100, minute=100, second=100;
   if (sscanf(cp, "%u-%u-%u %u:%u:%u", &year, &month,
                 &day, &hour, &minute, &second) < 6) {
-    log_warn(LD_GENERAL, "Published time was unparseable"); return -1;
+    log_warn(LD_GENERAL, "ISO time time was unparseable"); return -1;
   }
   if (year < 1970 || month < 1 || month > 12 || day < 1 || day > 31 ||
           hour > 23 || minute > 59 || second > 61) {
-    log_warn(LD_GENERAL, "Published time was nonsensical"); return -1;
+    log_warn(LD_GENERAL, "ISO time was nonsensical"); return -1;
   }
   st_tm.tm_year = year-1900;
   st_tm.tm_mon = month-1;
@@ -1876,7 +1876,7 @@
   /* XXXX Can this be right on IPv6 clients? */
   if (getsockname(sock, (struct sockaddr*)&my_addr, &my_addr_len)) {
     int e = tor_socket_errno(sock);
-    log_fn(severity, LD_NET, "getsockname() failed: %s",
+    log_fn(severity, LD_NET, "getsockname() to determine interface failed: %s",
            tor_socket_strerror(e));
     goto err;
   }

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/config.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -663,7 +663,7 @@
 
   SMARTLIST_FOREACH(new_listeners, connection_t *, conn,
   {
-    log_notice(LD_NET, "Closing %s on %s:%d",
+    log_notice(LD_NET, "Closing partially-constructed listener %s on %s:%d",
                conn_type_to_string(conn->type), conn->address, conn->port);
     connection_close_immediate(conn);
     connection_mark_for_close(conn);
@@ -800,7 +800,7 @@
                "Worker-related options changed. Rotating workers.");
       if (server_mode(options) && !server_mode(old_options)) {
         if (init_keys() < 0) {
-          log_err(LD_GENERAL,"Error initializing keys; exiting");
+          log_err(LD_BUG,"Error initializing keys; exiting");
           return -1;
         }
         server_has_changed_ip();
@@ -3473,7 +3473,7 @@
     }
     log_notice(LD_CONFIG, "Renaming old configuration file to \"%s\"", fn_tmp);
     if (rename(fname, fn_tmp) < 0) {
-      log_warn(LD_FS, "Couldn't rename \"%s\" to \"%s\": %s",
+      log_warn(LD_FS, "Couldn't rename configuration file \"%s\" to \"%s\": %s",
              fname, fn_tmp, strerror(errno));
       tor_free(fn_tmp);
       goto err;

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/connection.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -743,7 +743,9 @@
     remotelen=256;
     memset(addrbuf, 0, sizeof(addrbuf));
     if (getsockname(news, (struct sockaddr*)addrbuf, &remotelen)<0) {
-      log_warn(LD_NET, "getsockname() failed.");
+      int e = tor_socket_errno(news);
+      log_warn(LD_NET, "getsockname() for new connection failed: %s",
+               tor_socket_strerror(tor_socket_strerror(e)));
     } else {
       if (check_sockaddr_in((struct sockaddr*)addrbuf, remotelen,
                             LOG_WARN) < 0) {
@@ -963,7 +965,7 @@
     if (force) {
       /* It's a listener, and we're relaunching all listeners of this
        * type. Close this one. */
-      log_fn(LOG_NOTICE, LD_NET, "Closing %s on %s:%d",
+      log_notice(LD_NET, "Force-closing listener %s on %s:%d",
              conn_type_to_string(type), conn->address, conn->port);
       connection_close_immediate(conn);
       connection_mark_for_close(conn);
@@ -988,7 +990,7 @@
       });
     if (! line) {
       /* This one isn't configured. Close it. */
-      log_notice(LD_NET, "Closing %s on %s:%d",
+      log_notice(LD_NET, "Closing no-longer-configured %s on %s:%d",
                  conn_type_to_string(type), conn->address, conn->port);
       if (replaced_conns) {
         smartlist_add(replaced_conns, conn);
@@ -2005,7 +2007,8 @@
 
   if (getsockname(sock, (struct sockaddr*)&out_addr, &out_addr_len)<0) {
     int e = tor_socket_errno(sock);
-    log_warn(LD_NET, "getsockname() failed: %s", tor_socket_strerror(e));
+    log_warn(LD_NET, "getsockname() to check for address change failed: %s",
+             tor_socket_strerror(e));
     return;
   }
 

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/connection_edge.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -1310,7 +1310,8 @@
   if (getsockname(conn->_base.s, (struct sockaddr*)&proxy_addr,
                   &proxy_addr_len) < 0) {
     int e = tor_socket_errno(conn->_base.s);
-    log_warn(LD_NET, "getsockname() failed: %s", tor_socket_strerror(e));
+    log_warn(LD_NET, "getsockname() to determine transocks destination "
+             "failed: %s", tor_socket_strerror(e));
     return -1;
   }
 

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/control.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -726,7 +726,7 @@
     tor_free(config);
   } else {
     if (config_get_lines(body, &lines) < 0) {
-      log_warn(LD_CONTROL,"Controller gave us config lines we can't parse.");
+      log_warn(LD_CONTROL,"V0 controller gave us config lines we can't parse.");
       send_control0_error(conn, ERR_SYNTAX, "Couldn't parse configuration");
       return 0;
     }
@@ -2262,7 +2262,8 @@
 {
   if (command_type == CONTROL0_CMD_FRAGMENTHEADER) {
     if (conn->incoming_cmd) {
-      log_warn(LD_CONTROL, "Dropping incomplete fragmented command");
+      log_warn(LD_CONTROL, "Dropping incomplete fragmented command; new "
+               "fragmented command was begun.");
       tor_free(conn->incoming_cmd);
     }
     if (body_len < 6) {

Modified: tor/trunk/src/or/cpuworker.c
===================================================================
--- tor/trunk/src/or/cpuworker.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/cpuworker.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -110,7 +110,7 @@
 int
 connection_cpu_reached_eof(connection_t *conn)
 {
-  log_warn(LD_GENERAL,"Read eof. Worker died unexpectedly.");
+  log_warn(LD_GENERAL,"Read eof. CPU worker died unexpectedly.");
   if (conn->state != CPUWORKER_STATE_IDLE) {
     /* the circ associated with this cpuworker will have to wait until
      * it gets culled in run_connection_housekeeping(), since we have
@@ -322,7 +322,7 @@
 
   fdarray = tor_malloc(sizeof(int)*2);
   if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) {
-    log_warn(LD_NET, "Couldn't construct socketpair: %s",
+    log_warn(LD_NET, "Couldn't construct socketpair for cpuworker: %s",
              tor_socket_strerror(-err));
     tor_free(fdarray);
     return -1;

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/directory.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -968,7 +968,7 @@
              (int)body_len, conn->_base.address, conn->_base.port);
     if (status_code != 200) {
       log_warn(LD_DIR,"Received http status code %d (%s) from server "
-               "'%s:%d'. I'll try again soon.",
+               "'%s:%d' while fetching directory. I'll try again soon.",
                status_code, escaped(reason), conn->_base.address,
                conn->_base.port);
       tor_free(body); tor_free(headers); tor_free(reason);
@@ -986,7 +986,7 @@
     log_info(LD_DIR,"Received running-routers list (size %d)", (int)body_len);
     if (status_code != 200) {
       log_warn(LD_DIR,"Received http status code %d (%s) from server "
-               "'%s:%d'. I'll try again soon.",
+               "'%s:%d' while fetching running-routers. I'll try again soon.",
                status_code, escaped(reason), conn->_base.address,
                conn->_base.port);
       tor_free(body); tor_free(headers); tor_free(reason);
@@ -1157,7 +1157,8 @@
         break;
       default:
         log_warn(LD_GENERAL,
-             "http status %d (%s) reason unexpected (server '%s:%d').",
+             "http status %d (%s) reason unexpected while uploding "
+             "descriptor to server '%s:%d').",
              status_code, escaped(reason), conn->_base.address,
              conn->_base.port);
         break;
@@ -1192,7 +1193,8 @@
                  "rendezvous query?", escaped(reason));
         break;
       default:
-        log_warn(LD_REND,"http status %d (%s) response unexpected (server "
+        log_warn(LD_REND,"http status %d (%s) response unexpected while "
+                 "fetching hidden service descriptor (server "
                  "'%s:%d').",
                  status_code, escaped(reason), conn->_base.address,
                  conn->_base.port);

Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/dns.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -1069,7 +1069,7 @@
 int
 connection_dns_reached_eof(connection_t *conn)
 {
-  log_warn(LD_EXIT,"Read eof. Worker died unexpectedly.");
+  log_warn(LD_EXIT,"Read eof. DNS worker died unexpectedly.");
   if (conn->state == DNSWORKER_STATE_BUSY) {
     /* don't cancel the resolve here -- it would be cancelled in
      * connection_about_to_close_connection(), since conn is still
@@ -1278,7 +1278,7 @@
 
   fdarray = tor_malloc(sizeof(int)*2);
   if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) {
-    log_warn(LD_NET, "Couldn't construct socketpair: %s",
+    log_warn(LD_NET, "Couldn't construct socketpair for dns worker: %s",
              tor_socket_strerror(-err));
     tor_free(fdarray);
     return -1;

Modified: tor/trunk/src/or/hibernate.c
===================================================================
--- tor/trunk/src/or/hibernate.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/hibernate.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -622,7 +622,7 @@
   n_written = tor_parse_uint64(smartlist_get(elts,4), 10, 0, UINT64_MAX,
                                &ok, NULL);
   if (!ok) {
-    log_warn(LD_ACCT, "Error parsing number of bytes read");
+    log_warn(LD_ACCT, "Error parsing number of bytes written");
     goto err;
   }
   n_seconds = (uint32_t)tor_parse_ulong(smartlist_get(elts,5), 10,0,ULONG_MAX,

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/main.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -1139,7 +1139,7 @@
    * TLS context. */
   if (! identity_key_is_set()) {
     if (init_keys() < 0) {
-      log_err(LD_GENERAL,"Error initializing keys; exiting");
+      log_err(LD_BUG,"Error initializing keys; exiting");
       return -1;
     }
   }
@@ -1520,7 +1520,7 @@
       "Do not rely on it for strong anonymity.",VERSION);
 
   if (network_init()<0) {
-    log_err(LD_NET,"Error initializing network; exiting.");
+    log_err(LD_BUG,"Error initializing network; exiting.");
     return -1;
   }
   atexit(exit_function);
@@ -1622,7 +1622,7 @@
   }
   tor_assert(nickname);
   if (init_keys() < 0) {
-    log_err(LD_BUG,"Error initializing keys; exiting");
+    log_err(LD_BUG,"Error initializing keys; can't display fingerprint");
     return -1;
   }
   if (!(k = get_identity_key())) {

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/router.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -139,7 +139,7 @@
       goto error;
   }
   if (crypto_pk_write_private_key_to_filename(prkey, fname)) {
-    log_err(LD_FS,"Couldn't write generated key to \"%s\".", fname);
+    log_err(LD_FS,"Couldn't write generated onion key to \"%s\".", fname);
     goto error;
   }
   log_info(LD_GENERAL, "Rotating onion key");
@@ -169,7 +169,7 @@
 
   /* The old filename exists, and the new one doesn't.  Rename and load. */
   if (rename(fname_old, fname_new) < 0) {
-    log_warn(LD_FS, "Couldn't rename \"%s\" to \"%s\": %s",
+    log_warn(LD_FS, "Couldn't rename key file \"%s\" to \"%s\": %s",
              fname_old, fname_new, strerror(errno));
     return NULL;
   }

Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/or/routerparse.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -462,12 +462,12 @@
   smartlist_t *tokens = NULL;
 
   if (router_get_runningrouters_hash(str, digest)) {
-    log_warn(LD_DIR, "Unable to compute digest of directory");
+    log_warn(LD_DIR, "Unable to compute digest of running-routers");
     goto err;
   }
   tokens = smartlist_create();
   if (tokenize_string(str,str+strlen(str),tokens,DIR)) {
-    log_warn(LD_DIR, "Error tokenizing directory"); goto err;
+    log_warn(LD_DIR, "Error tokenizing running-routers"); goto err;
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
     log_warn(LD_DIR, "Unrecognized keyword %s; can't parse running-routers",
@@ -859,7 +859,7 @@
     }
     tor_strstrip(tok->args[0], " ");
     if (base16_decode(d, DIGEST_LEN, tok->args[0], strlen(tok->args[0]))) {
-      log_warn(LD_DIR, "Couldn't decode fingerprint %s",
+      log_warn(LD_DIR, "Couldn't decode router fingerprint %s",
                escaped(tok->args[0]));
       goto err;
     }
@@ -1034,7 +1034,8 @@
   }
 
   if (tor_inet_aton(tok->args[5], &in) == 0) {
-    log_warn(LD_DIR, "Error parsing address %s", escaped(tok->args[5]));
+    log_warn(LD_DIR, "Error parsing router address in network-status %s",
+             escaped(tok->args[5]));
     goto err;
   }
   rs->addr = ntohl(in.s_addr);
@@ -1147,7 +1148,8 @@
   }
   ns->source_address = tok->args[0]; tok->args[0] = NULL;
   if (tor_inet_aton(tok->args[1], &in) == 0) {
-    log_warn(LD_DIR, "Error parsing address %s", escaped(tok->args[1]));
+    log_warn(LD_DIR, "Error parsing network-status source address %s",
+             escaped(tok->args[1]));
     goto err;
   }
   ns->source_addr = ntohl(in.s_addr);
@@ -1168,7 +1170,8 @@
   }
   if (base16_decode(ns->identity_digest, DIGEST_LEN, tok->args[0],
                     strlen(tok->args[0]))) {
-    log_warn(LD_DIR, "Couldn't decode fingerprint %s", escaped(tok->args[0]));
+    log_warn(LD_DIR, "Couldn't decode networkstatus fingerprint %s",
+             escaped(tok->args[0]));
     goto err;
   }
 
@@ -1766,7 +1769,7 @@
   ++end;
 
   if (crypto_digest(digest, start, end-start)) {
-    log_warn(LD_DIR,"couldn't compute digest");
+    log_warn(LD_BUG,"couldn't compute digest");
     return -1;
   }
 

Modified: tor/trunk/src/tools/tor-resolve.c
===================================================================
--- tor/trunk/src/tools/tor-resolve.c	2006-09-29 22:33:34 UTC (rev 8541)
+++ tor/trunk/src/tools/tor-resolve.c	2006-09-29 22:33:40 UTC (rev 8542)
@@ -238,7 +238,7 @@
   }
 
   if (network_init()<0) {
-    log_err(LD_NET,"Error initializing network; exiting.");
+    log_err(LD_BUG,"Error initializing network; exiting.");
     return 1;
   }