[or-cvs] Clarify a bunch of log messages

Nick Mathewson nickm at seul.org
Thu Nov 25 04:20:12 UTC 2004


Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv18252/src/or

Modified Files:
	connection_or.c directory.c dirserv.c main.c router.c 
	routerlist.c routerparse.c 
Log Message:
Clarify a bunch of log messages

Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_or.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- connection_or.c	22 Nov 2004 22:24:10 -0000	1.144
+++ connection_or.c	25 Nov 2004 04:20:09 -0000	1.145
@@ -92,7 +92,7 @@
   tor_assert(conn->type == CONN_TYPE_OR);
   tor_assert(conn->state == OR_CONN_STATE_CONNECTING);
 
-  log_fn(LOG_INFO,"OR connect() to router %s:%u finished.",
+  log_fn(LOG_INFO,"OR connect() to router at %s:%u finished.",
          conn->address,conn->port);
 
   if(connection_tls_start_handshake(conn, 0) < 0) {
@@ -219,7 +219,7 @@
   conn = connection_get_by_identity_digest(id_digest, CONN_TYPE_OR);
   if(conn) {
     tor_assert(conn->nickname);
-    log_fn(LOG_WARN,"Asked me to connect to %s, but there's already a connection.", conn->nickname);
+    log_fn(LOG_WARN,"Asked me to connect to router '%s', but there's already a connection.", conn->nickname);
     return conn;
   }
 
@@ -358,11 +358,11 @@
            conn->address, conn->port);
     return -1;
   }
-  log_fn(LOG_DEBUG, "Other side (%s:%d) claims to be '%s'", conn->address,
-         conn->port, nickname);
+  log_fn(LOG_DEBUG, "Other side (%s:%d) claims to be router '%s'",
+         conn->address, conn->port, nickname);
 
   if(tor_tls_verify(conn->tls, &identity_rcvd) < 0) {
-    log_fn(LOG_WARN,"Other side '%s' (%s:%d) has a cert but it's invalid. Closing.",
+    log_fn(LOG_WARN,"Other side, which claims to be router '%s' (%s:%d), has a cert but it's invalid. Closing.",
            nickname, conn->address, conn->port);
     return -1;
   }
@@ -387,7 +387,7 @@
   if(router && /* we know this nickname */
      router->is_verified && /* make sure it's the right guy */
      memcmp(digest_rcvd, router->identity_digest, DIGEST_LEN) != 0) {
-    log_fn(LOG_WARN, "Identity key not as expected for %s", nickname);
+    log_fn(LOG_WARN, "Identity key not as expected for router claiming to be '%s' (%s:%d) ", nickname, conn->address, conn->port);
     return -1;
   }
   if (router_get_by_digest(digest_rcvd)) {
@@ -410,7 +410,7 @@
     }
   } else {
     if((c=connection_get_by_identity_digest(digest_rcvd, CONN_TYPE_OR))) {
-      log_fn(LOG_INFO,"Router %s is already connected on fd %d. Dropping fd %d.", nickname, c->s, conn->s);
+      log_fn(LOG_INFO,"Router '%s' is already connected on fd %d. Dropping fd %d.", nickname, c->s, conn->s);
       return -1;
     }
     connection_or_init_conn_from_address(conn,conn->addr,conn->port,digest_rcvd);

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -d -r1.170 -r1.171
--- directory.c	22 Nov 2004 23:28:26 -0000	1.170
+++ directory.c	25 Nov 2004 04:20:09 -0000	1.171
@@ -285,7 +285,7 @@
         router_mark_as_down(conn->identity_digest); /* don't try him again */
         if(purpose == DIR_PURPOSE_FETCH_DIR &&
            !all_trusted_directory_servers_down()) {
-          log_fn(LOG_INFO,"Giving up on dirserver %s; trying another.", conn->address);
+          log_fn(LOG_INFO,"Giving up on dirserver '%s'; trying another.", conn->address);
           directory_get_from_dirserver(purpose, NULL);
         }
         connection_free(conn);

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- dirserv.c	22 Nov 2004 23:28:26 -0000	1.122
+++ dirserv.c	25 Nov 2004 04:20:09 -0000	1.123
@@ -110,12 +110,12 @@
   for(list=front; list; list=list->next) {
     nickname = list->key; fingerprint = list->value;
     if (strlen(nickname) > MAX_NICKNAME_LEN) {
-      log(LOG_WARN, "Nickname %s too long in fingerprint file. Skipping.", nickname);
+      log(LOG_WARN, "Nickname '%s' too long in fingerprint file. Skipping.", nickname);
       continue;
     }
     if(strlen(fingerprint) != FINGERPRINT_LEN ||
        !crypto_pk_check_fingerprint_syntax(fingerprint)) {
-      log_fn(LOG_WARN, "Invalid fingerprint (nickname %s, fingerprint %s). Skipping.",
+      log_fn(LOG_WARN, "Invalid fingerprint (nickname '%s', fingerprint %s). Skipping.",
              nickname, fingerprint);
       continue;
     }
@@ -130,7 +130,7 @@
     for (i = 0; i < smartlist_len(fingerprint_list_new); ++i) {
       ent = smartlist_get(fingerprint_list_new, i);
       if (0==strcasecmp(ent->nickname, nickname)) {
-        log(LOG_WARN, "Duplicate nickname %s. Skipping.",nickname);
+        log(LOG_WARN, "Duplicate nickname '%s'. Skipping.",nickname);
         break; /* out of the for. the 'if' below means skip to the next line. */
       }
     }
@@ -176,7 +176,7 @@
   }
 
   if (!found) { /* No such server known */
-    log_fn(LOG_INFO,"no fingerprint found for %s",router->nickname);
+    log_fn(LOG_INFO,"no fingerprint found for '%s'",router->nickname);
     return 0;
   }
   if (crypto_pk_get_fingerprint(router->identity_pkey, fp, 0)) {
@@ -184,10 +184,10 @@
     return -1;
   }
   if (0==strcasecmp(ent->fingerprint, fp)) {
-    log_fn(LOG_DEBUG,"good fingerprint for %s",router->nickname);
+    log_fn(LOG_DEBUG,"good fingerprint for '%s'",router->nickname);
     return 1; /* Right fingerprint. */
   } else {
-    log_fn(LOG_WARN,"mismatched fingerprint for %s",router->nickname);
+    log_fn(LOG_WARN,"mismatched fingerprint for '%s'",router->nickname);
     return -1; /* Wrong fingerprint. */
   }
 }
@@ -332,17 +332,17 @@
   /* Okay.  Now check whether the fingerprint is recognized. */
   r = dirserv_router_fingerprint_is_known(ri);
   if(r==-1) {
-    log_fn(LOG_WARN, "Known nickname %s, wrong fingerprint. Not adding.", ri->nickname);
+    log_fn(LOG_WARN, "Known nickname '%s', wrong fingerprint. Not adding.", ri->nickname);
     routerinfo_free(ri);
     *desc = end;
     return 0;
   }
   if(r==0) {
     char fp[FINGERPRINT_LEN+1];
-    log_fn(LOG_INFO, "Unknown nickname %s (%s:%d). Adding.",
+    log_fn(LOG_INFO, "Unknown nickname '%s' (%s:%d). Adding.",
            ri->nickname, ri->address, ri->or_port);
     if (crypto_pk_get_fingerprint(ri->identity_pkey, fp, 1) < 0) {
-      log_fn(LOG_WARN, "Error computing fingerprint for %s", ri->nickname);
+      log_fn(LOG_WARN, "Error computing fingerprint for '%s'", ri->nickname);
     } else {
       log_fn(LOG_INFO, "Fingerprint line: %s %s", ri->nickname, fp);
     }
@@ -351,13 +351,13 @@
   /* Is there too much clock skew? */
   now = time(NULL);
   if (ri->published_on > now+ROUTER_ALLOW_SKEW) {
-    log_fn(LOG_WARN, "Publication time for nickname %s is too far in the future; possible clock skew. Not adding.", ri->nickname);
+    log_fn(LOG_WARN, "Publication time for nickname '%s' is too far in the future; possible clock skew. Not adding.", ri->nickname);
     routerinfo_free(ri);
     *desc = end;
     return 0;
   }
   if (ri->published_on < now-ROUTER_MAX_AGE) {
-    log_fn(LOG_WARN, "Publication time for router with nickname %s is too far in the past. Not adding.", ri->nickname);
+    log_fn(LOG_WARN, "Publication time for router with nickname '%s' is too far in the past. Not adding.", ri->nickname);
     routerinfo_free(ri);
     *desc = end;
     return 0;
@@ -375,19 +375,19 @@
     /* if so, decide whether to update it. */
     if (ent->published >= ri->published_on) {
       /* We already have a newer or equal-time descriptor */
-      log_fn(LOG_INFO,"We already have a new enough desc for nickname %s. Not adding.",ri->nickname);
+      log_fn(LOG_INFO,"We already have a new enough desc for nickname '%s'. Not adding.",ri->nickname);
       /* This isn't really an error; return success. */
       routerinfo_free(ri);
       *desc = end;
       return 1;
     }
     /* We don't have a newer one; we'll update this one. */
-    log_fn(LOG_INFO,"Dirserv updating desc for nickname %s",ri->nickname);
+    log_fn(LOG_INFO,"Dirserv updating desc for nickname '%s'",ri->nickname);
     free_descriptor_entry(ent);
     smartlist_del_keeporder(descriptor_list, found);
   } else {
     /* Add at the end. */
-    log_fn(LOG_INFO,"Dirserv adding desc for nickname %s",ri->nickname);
+    log_fn(LOG_INFO,"Dirserv adding desc for nickname '%s'",ri->nickname);
   }
 
   ent = tor_malloc(sizeof(descriptor_entry_t));
@@ -420,7 +420,7 @@
   for (i = 0; i < smartlist_len(descriptor_list); ++i) {
     ent = smartlist_get(descriptor_list, i);
     if (dirserv_router_fingerprint_is_known(ent->router)<=0) {
-      log(LOG_INFO, "Router %s is no longer recognized",
+      log(LOG_INFO, "Router '%s' is no longer recognized",
           ent->nickname);
       free_descriptor_entry(ent);
       smartlist_del(descriptor_list, i--);

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.388
retrieving revision 1.389
diff -u -d -r1.388 -r1.389
--- main.c	24 Nov 2004 03:58:45 -0000	1.388
+++ main.c	25 Nov 2004 04:20:09 -0000	1.389
@@ -772,7 +772,7 @@
     /* Rebuild fresh descriptor. */
     router_rebuild_descriptor(1);
     tor_snprintf(keydir,sizeof(keydir),"%s/router.desc", options->DataDirectory);
-    log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir);
+    log_fn(LOG_INFO,"Saving descriptor to %s...",keydir);
     if (write_str_to_file(keydir, router_get_my_descriptor(), 0)) {
       return -1;
     }

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- router.c	22 Nov 2004 23:28:26 -0000	1.126
+++ router.c	25 Nov 2004 04:20:09 -0000	1.127
@@ -404,7 +404,7 @@
     if(!connection_get_by_identity_digest(router->identity_digest,
                                           CONN_TYPE_OR)) {
       /* not in the list */
-      log_fn(LOG_DEBUG,"connecting to OR %s:%u.",router->address,router->or_port);
+      log_fn(LOG_DEBUG,"connecting to OR at %s:%u.",router->address,router->or_port);
       connection_or_connect(router->addr, router->or_port, router->identity_digest);
     }
   }

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -d -r1.188 -r1.189
--- routerlist.c	20 Nov 2004 12:41:05 -0000	1.188
+++ routerlist.c	25 Nov 2004 04:20:09 -0000	1.189
@@ -59,7 +59,7 @@
     log_fn(LOG_INFO, "Loading cached directory from %s", filename);
     is_recent = st.st_mtime > time(NULL) - 60*15;
     if (router_load_routerlist_from_directory(s, NULL, is_recent) < 0) {
-      log_fn(LOG_WARN, "Cached directory '%s' was unparseable; ignoring.", filename);
+      log_fn(LOG_WARN, "Cached directory at '%s' was unparseable; ignoring.", filename);
     }
     if(routerlist &&
        ((routerlist->published_on > time(NULL) - OLD_MIN_ONION_KEY_LIFETIME/2)
@@ -406,7 +406,7 @@
   for (i = 0; i < smartlist_len(sl); ++i) {
     router = smartlist_get(sl, i);
     if(router_is_unreliable_router(router, 1, 0)) {
-      log(LOG_DEBUG, "Router %s has insufficient uptime; deleting.",
+      log(LOG_DEBUG, "Router '%s' has insufficient uptime; deleting.",
           router->nickname);
       smartlist_del(sl, i--);
     }
@@ -719,7 +719,7 @@
   router = router_get_by_digest(digest);
   if(!router) /* we don't seem to know about him in the first place */
     return;
-  log_fn(LOG_DEBUG,"Marking %s as down.",router->nickname);
+  log_fn(LOG_DEBUG,"Marking router '%s' as down.",router->nickname);
   if (router_is_me(router))
     log_fn(LOG_WARN, "We just marked ourself as down. Are your external addresses reachable?");
   router->is_running = 0;
@@ -819,7 +819,7 @@
     router = smartlist_get(routerlist->routers, i);
     if (router->published_on <= cutoff) {
       /* Too old.  Remove it. */
-      log_fn(LOG_INFO,"Forgetting obsolete routerinfo for node %s.", router->nickname);
+      log_fn(LOG_INFO,"Forgetting obsolete routerinfo for router '%s'", router->nickname);
       routerinfo_free(router);
       smartlist_del(routerlist->routers, i--);
     }
@@ -872,8 +872,8 @@
 {
   if (tor_lookup_hostname(router->address, &router->addr) != 0
       || !router->addr) {
-    log_fn(LOG_WARN,"Could not get address for router %s (%s).",
-           router->address, router->nickname);
+    log_fn(LOG_WARN,"Could not resolve address for router '%s' at %s",
+           router->nickname, router->address);
     return -1;
   }
   router->addr = ntohl(router->addr); /* get it back into host order */
@@ -906,7 +906,8 @@
     } else if (r->addr) {
       /* already resolved. */
     } else if (router_resolve(r)) {
-      log_fn(LOG_WARN, "Couldn't resolve router %s; not using", r->address);
+      log_fn(LOG_WARN, "Couldn't resolve router '%s' at '%s'; not using",
+             r->nickname, r->address);
       remove = 1;
     }
     if (remove) {

Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- routerparse.c	22 Nov 2004 23:28:26 -0000	1.82
+++ routerparse.c	25 Nov 2004 04:20:10 -0000	1.83
@@ -212,7 +212,7 @@
 
   vl = versionlist;
 
-  log_fn(LOG_DEBUG,"checking '%s' in '%s'.", myversion, versionlist);
+  log_fn(LOG_DEBUG,"Checking whether version '%s' is in '%s'", myversion, versionlist);
 
   if (tor_version_parse(myversion, &mine)) {
     log_fn(LOG_ERR, "I couldn't parse my own version (%s)", myversion);
@@ -437,7 +437,7 @@
                                              good_nickname_list,
                                           tok->tp==K_RUNNING_ROUTERS)==1 &&
         me->is_verified == 0 && !have_warned_about_unverified_status) {
-        log_fn(LOG_WARN,"Dirserver %s lists your server as unverified. Please consider sending your identity fingerprint to the tor-ops.", dirnickname);
+        log_fn(LOG_WARN,"Dirserver '%s' lists your server as unverified. Please consider sending your identity fingerprint to the tor-ops.", dirnickname);
         have_warned_about_unverified_status = 1;
       }
     }
@@ -495,7 +495,7 @@
     log_fn(LOG_WARN, "Error tokenizing directory"); goto err;
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
-    log_fn(LOG_WARN, "Unrecognized keyword \"%s\"; can't parse running-routers",
+    log_fn(LOG_WARN, "Unrecognized keyword '%s'; can't parse running-routers",
            tok->args[0]);
     goto err;
   }
@@ -774,7 +774,7 @@
     goto err;
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
-    log_fn(LOG_WARN, "Unrecognized keyword \"%s\"; skipping descriptor.",
+    log_fn(LOG_WARN, "Unrecognized keyword '%s'; skipping descriptor.",
            tok->args[0]);
     goto err;
   }
@@ -841,7 +841,7 @@
   } else if (tok) {
     if (tok->n_args < 3) {
       /* XXXX Once 0.0.7 is *really* dead, restore this warning to its old form*/
-      log_fn(LOG_WARN,"Not enough arguments to \"bandwidth\": must be an obsolete server. Rejecting (nickname %s).", router->nickname);
+      log_fn(LOG_WARN,"Not enough arguments to \"bandwidth\": must be an obsolete server. Rejecting one server (nickname '%s').", router->nickname);
       goto err;
     }
     router->bandwidthrate = tor_parse_long(tok->args[0],10,0,INT_MAX,NULL,NULL);
@@ -905,7 +905,7 @@
     router->declared_family = smartlist_create();
     for (i=0;i<tok->n_args;++i) {
       if (!is_legal_nickname_or_hexdigest(tok->args[i])) {
-        log_fn(LOG_WARN, "Illegal nickname %s in family line", tok->args[i]);
+        log_fn(LOG_WARN, "Illegal nickname '%s' in family line", tok->args[i]);
         goto err;
       }
       smartlist_add(router->declared_family, tor_strdup(tok->args[i]));



More information about the tor-commits mailing list