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

[or-cvs] when reporting results from a dirserver fetch/post, tell us...



Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	directory.c 
Log Message:
when reporting results from a dirserver fetch/post, tell us the
port for the dirserver too


Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -d -r1.260 -r1.261
--- directory.c	8 Sep 2005 18:46:25 -0000	1.260
+++ directory.c	8 Sep 2005 19:21:48 -0000	1.261
@@ -749,7 +749,7 @@
                               &headers, MAX_HEADERS_SIZE,
                               &body, &body_len, MAX_DIR_SIZE)) {
     case -1: /* overflow */
-      log_fn(LOG_WARN,"'fetch' response too large (server '%s'). Failing.", conn->address);
+      log_fn(LOG_WARN,"'fetch' response too large (server '%s:%d'). Failing.", conn->address, conn->port);
       return -1;
     case 0:
       log_fn(LOG_INFO,"'fetch' response not all here, but we're at eof. Closing.");
@@ -759,23 +759,23 @@
 
   if (parse_http_response(headers, &status_code, &date_header,
                           &compression, &reason) < 0) {
-    log_fn(LOG_WARN,"Unparseable headers (server '%s'). Closing.", conn->address);
+    log_fn(LOG_WARN,"Unparseable headers (server '%s:%d'). Closing.", conn->address, conn->port);
     tor_free(body); tor_free(headers);
     return -1;
   }
   if (!reason) reason = tor_strdup("[no reason given]");
 
   log_fn(LOG_DEBUG,
-         "Received response from directory server '%s': %d \"%s\"",
-         conn->address, status_code, reason);
+         "Received response from directory server '%s:%d': %d \"%s\"",
+         conn->address, conn->port, status_code, reason);
 
   if (date_header > 0) {
     now = time(NULL);
     delta = now-date_header;
     if (abs(delta)>ALLOW_DIRECTORY_TIME_SKEW) {
       log_fn(router_digest_is_trusted_dir(conn->identity_digest) ? LOG_WARN : LOG_INFO,
-             "Received directory with skewed time (server '%s'): we are %d minutes %s, or the directory is %d minutes %s.",
-             conn->address,
+             "Received directory with skewed time (server '%s:%d'): we are %d minutes %s, or the directory is %d minutes %s.",
+             conn->address, conn->port,
              abs(delta)/60, delta>0 ? "ahead" : "behind",
              abs(delta)/60, delta>0 ? "behind" : "ahead");
       skewed = 1; /* don't check the recommended-versions line */
@@ -809,9 +809,9 @@
       else
         description2 = "uncompressed";
 
-      log_fn(LOG_INFO, "HTTP body from server '%s' was labeled %s, "
+      log_fn(LOG_INFO, "HTTP body from server '%s:%d' was labeled %s, "
              "but it seems to be %s.%s",
-             conn->address, description1, description2,
+             conn->address, conn->port, description1, description2,
              (compression>0 && guessed>0)?"  Trying both.":"");
     }
     /* Try declared compression first if we can. */
@@ -824,7 +824,8 @@
     /* If we're pretty sure that we have a compressed directory, and
      * we didn't manage to uncompress it, then warn and bail. */
     if (!plausible && !new_body) {
-      log_fn(LOG_WARN, "Unable to decompress HTTP body (server '%s').", conn->address);
+      log_fn(LOG_WARN, "Unable to decompress HTTP body (server '%s:%d').",
+             conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -837,8 +838,8 @@
 
   if (conn->purpose == DIR_PURPOSE_FETCH_DIR) {
     /* fetch/process the directory to learn about new routers. */
-    log_fn(LOG_INFO,"Received directory (size %d) from server '%s'",
-           (int)body_len, conn->address);
+    log_fn(LOG_INFO,"Received directory (size %d) from server '%s:%d'",
+           (int)body_len, conn->address, conn->port);
     if (status_code == 503 || body_len == 0) {
       log_fn(LOG_INFO,"Empty directory; status %d (\"%s\") Ignoring.",
              status_code, reason);
@@ -846,13 +847,13 @@
       return 0;
     }
     if (status_code != 200) {
-      log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s'. Failing.",
-             status_code, reason, conn->address);
+      log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s:%d'. Failing.",
+             status_code, reason, conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
     if (router_load_routerlist_from_directory(body, NULL, !skewed, 0) < 0) {
-      log_fn(LOG_NOTICE,"I failed to parse the directory I fetched from %s:%d. Ignoring.", conn->address, conn->port);
+      log_fn(LOG_NOTICE,"I failed to parse the directory I fetched from '%s:%d'. Ignoring.", conn->address, conn->port);
     } else {
       log_fn(LOG_INFO,"updated routers.");
     }
@@ -866,13 +867,14 @@
     /* just update our list of running routers, if this list is new info */
     log_fn(LOG_INFO,"Received running-routers list (size %d)", (int)body_len);
     if (status_code != 200) {
-      log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s'. Failing.",
-             status_code, reason, conn->address);
+      log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s:%d'. Failing.",
+             status_code, reason, conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
     if (!(rrs = router_parse_runningrouters(body, 1))) {
-      log_fn(LOG_WARN, "Can't parse runningrouters list (server '%s')", conn->address);
+      log_fn(LOG_WARN, "Can't parse runningrouters list (server '%s:%d')",
+             conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -888,10 +890,10 @@
   if (conn->purpose == DIR_PURPOSE_FETCH_NETWORKSTATUS) {
     /* XXXX NM We *must* make certain we get the one(s) we asked for or we
      * could be partitioned. */
-    log_fn(LOG_INFO,"Received networkstatus objects (size %d) from server '%s'",(int) body_len, conn->address);
+    log_fn(LOG_INFO,"Received networkstatus objects (size %d) from server '%s:%d'",(int) body_len, conn->address, conn->port);
     if (status_code != 200) {
-      log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s'. Failing.",
-             status_code, reason, conn->address);
+      log_fn(LOG_WARN,"Received http status code %d (\"%s\") from server '%s:%d'. Failing.",
+             status_code, reason, conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -919,13 +921,13 @@
         log_fn(LOG_INFO,"eof (status 200) after uploading server descriptor: finished.");
         break;
       case 400:
-        log_fn(LOG_WARN,"http status 400 (\"%s\") response from dirserver '%s'. Malformed server descriptor?", reason, conn->address);
+        log_fn(LOG_WARN,"http status 400 (\"%s\") response from dirserver '%s:%d'. Malformed server descriptor?", reason, conn->address, conn->port);
         break;
       case 403:
-        log_fn(LOG_WARN,"http status 403 (\"%s\") response from dirserver '%s'. Is your clock skewed? Have you mailed us your key fingerprint? Are you using the right key? Are you using a private IP address? See http://tor.eff.org/doc/tor-doc-server.html";, reason, conn->address);
+        log_fn(LOG_WARN,"http status 403 (\"%s\") response from dirserver '%s:%d'. Is your clock skewed? Have you mailed us your key fingerprint? Are you using the right key? Are you using a private IP address? See http://tor.eff.org/doc/tor-doc-server.html";, reason, conn->address, conn->port);
         break;
       default:
-        log_fn(LOG_WARN,"http status %d (\"%s\") reason unexpected (server '%s').", status_code, reason, conn->address);
+        log_fn(LOG_WARN,"http status %d (\"%s\") reason unexpected (server '%s:%d').", status_code, reason, conn->address, conn->port);
         break;
     }
   }
@@ -953,7 +955,7 @@
         log_fn(LOG_WARN,"http status 400 (\"%s\"). Dirserver didn't like our rendezvous query?", reason);
         break;
       default:
-        log_fn(LOG_WARN,"http status %d (\"%s\") response unexpected (server '%s').", status_code, reason, conn->address);
+        log_fn(LOG_WARN,"http status %d (\"%s\") response unexpected (server '%s:%d').", status_code, reason, conn->address, conn->port);
         break;
     }
   }
@@ -964,10 +966,10 @@
         log_fn(LOG_INFO,"Uploading rendezvous descriptor: finished with status 200 (\"%s\")", reason);
         break;
       case 400:
-        log_fn(LOG_WARN,"http status 400 (\"%s\") response from dirserver '%s'. Malformed rendezvous descriptor?", reason, conn->address);
+        log_fn(LOG_WARN,"http status 400 (\"%s\") response from dirserver '%s:%d'. Malformed rendezvous descriptor?", reason, conn->address, conn->port);
         break;
       default:
-        log_fn(LOG_WARN,"http status %d (\"%s\") response unexpected (server '%s').", status_code, reason, conn->address);
+        log_fn(LOG_WARN,"http status %d (\"%s\") response unexpected (server '%s:%d').", status_code, reason, conn->address, conn->port);
         break;
     }
   }