[or-cvs] when we changed from log_fn to debug/info/notice/warn/err,

arma at seul.org arma at seul.org
Sat Dec 10 09:36:28 UTC 2005


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

Modified Files:
	buffers.c circuitbuild.c circuitlist.c circuituse.c command.c 
	config.c connection.c connection_edge.c connection_or.c 
	control.c directory.c dirserv.c dns.c hibernate.c main.c 
	onion.c relay.c rendclient.c rendcommon.c rendmid.c 
	rendservice.c router.c routerlist.c routerparse.c 
Log Message:
when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

fix it before it becomes convention to format logs in wild and
unpredictable ways.

still need to do src/common/ someday.


Index: buffers.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/buffers.c,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- buffers.c	9 Dec 2005 05:37:26 -0000	1.181
+++ buffers.c	10 Dec 2005 09:36:25 -0000	1.182
@@ -285,7 +285,7 @@
     return;
 
   debug(LD_MM,"Shrinking buffer from %d to %d bytes.",
-         (int)buf->len, (int)new_len);
+        (int)buf->len, (int)new_len);
   buf_resize(buf, new_len);
 }
 
@@ -413,7 +413,7 @@
     if (buf->datalen > buf->highwater)
       buf->highwater = buf->datalen;
     debug(LD_NET,"Read %d bytes. %d on inbuf.",read_result,
-           (int)buf->datalen);
+          (int)buf->datalen);
     return read_result;
   }
 }
@@ -479,8 +479,8 @@
   int r;
 
   debug(LD_NET,"before: %d on buf, %d pending, at_most %d.",
-         (int)buf_datalen(buf), (int)tor_tls_get_pending_bytes(tls),
-         (int)at_most);
+        (int)buf_datalen(buf), (int)tor_tls_get_pending_bytes(tls),
+        (int)at_most);
   r = tor_tls_read(tls, next, at_most);
   if (r<0)
     return r;
@@ -489,7 +489,7 @@
   if (buf->datalen > buf->highwater)
     buf->highwater = buf->datalen;
   debug(LD_NET,"Read %d bytes. %d on inbuf; %d pending",r,
-         (int)buf->datalen,(int)tor_tls_get_pending_bytes(tls));
+        (int)buf->datalen,(int)tor_tls_get_pending_bytes(tls));
   return r;
 }
 
@@ -523,8 +523,8 @@
   assert_buf_ok(buf);
 
   debug(LD_NET,"start: %d on buf, %d pending, at_most %d.",
-         (int)buf_datalen(buf), (int)tor_tls_get_pending_bytes(tls),
-         (int)at_most);
+        (int)buf_datalen(buf), (int)tor_tls_get_pending_bytes(tls),
+        (int)at_most);
 
   if (buf_ensure_capacity(buf, at_most+buf->datalen))
     return TOR_TLS_ERROR;
@@ -610,7 +610,7 @@
   check();
 
   debug(LD_NET,"%d: flushed %d bytes, %d ready to flush, %d remain.",
-           s,r,(int)*buf_flushlen,(int)buf->datalen);
+        s,r,(int)*buf_flushlen,(int)buf->datalen);
   if (r < 0 || (size_t)r < flushlen0)
     return r; /* Error, or can't flush any more now. */
   flushed = r;
@@ -620,7 +620,7 @@
     r = flush_buf_impl(s, buf, flushlen1, buf_flushlen);
     check();
     debug(LD_NET,"%d: flushed %d bytes, %d ready to flush, %d remain.",
-           s,r,(int)*buf_flushlen,(int)buf->datalen);
+          s,r,(int)*buf_flushlen,(int)buf->datalen);
     if (r<0)
       return r;
     flushed += r;
@@ -645,7 +645,7 @@
   *buf_flushlen -= r;
   buf_remove_from_front(buf, r);
   debug(LD_NET,"flushed %d bytes, %d ready to flush, %d remain.",
-         r,(int)*buf_flushlen,(int)buf->datalen);
+        r,(int)*buf_flushlen,(int)buf->datalen);
   return r;
 }
 
@@ -706,7 +706,8 @@
   /* assert_buf_ok(buf); */
 
   if (buf_ensure_capacity(buf, buf->datalen+string_len)) {
-    warn(LD_MM, "buflen too small, can't hold %d bytes.", (int)(buf->datalen+string_len));
+    warn(LD_MM, "buflen too small, can't hold %d bytes.",
+         (int)(buf->datalen+string_len));
     return -1;
   }
 
@@ -726,7 +727,7 @@
   if (buf->datalen > buf->highwater)
     buf->highwater = buf->datalen;
   debug(LD_NET,"added %d bytes to buf (now %d total).",
-         (int)string_len, (int)buf->datalen);
+        (int)string_len, (int)buf->datalen);
   check();
   return buf->datalen;
 }
@@ -822,12 +823,13 @@
   debug(LD_HTTP,"headerlen %d, bodylen %d.", (int)headerlen, (int)bodylen);
 
   if (max_headerlen <= headerlen) {
-    warn(LD_HTTP,"headerlen %d larger than %d. Failing.", (int)headerlen,
-           (int)max_headerlen-1);
+    warn(LD_HTTP,"headerlen %d larger than %d. Failing.",
+         (int)headerlen, (int)max_headerlen-1);
     return -1;
   }
   if (max_bodylen <= bodylen) {
-    warn(LD_HTTP,"bodylen %d larger than %d. Failing.", (int)bodylen, (int)max_bodylen-1);
+    warn(LD_HTTP,"bodylen %d larger than %d. Failing.",
+         (int)bodylen, (int)max_bodylen-1);
     return -1;
   }
 
@@ -945,7 +947,7 @@
           req->command != SOCKS_COMMAND_RESOLVE) {
         /* not a connect or resolve? we don't support it. */
         warn(LD_APP,"socks5: command %d not recognized. Rejecting.",
-               req->command);
+             req->command);
         return -1;
       }
       switch (*(buf->cur+3)) { /* address type */
@@ -959,7 +961,7 @@
           tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
           if (strlen(tmpbuf)+1 > MAX_SOCKS_ADDR_LEN) {
             warn(LD_APP,"socks5 IP takes %d bytes, which doesn't fit in %d. Rejecting.",
-                   (int)strlen(tmpbuf)+1,(int)MAX_SOCKS_ADDR_LEN);
+                 (int)strlen(tmpbuf)+1,(int)MAX_SOCKS_ADDR_LEN);
             return -1;
           }
           strlcpy(req->address,tmpbuf,sizeof(req->address));
@@ -983,7 +985,7 @@
             return 0; /* not yet */
           if (len+1 > MAX_SOCKS_ADDR_LEN) {
             warn(LD_APP,"socks5 hostname is %d bytes, which doesn't fit in %d. Rejecting.",
-                   len+1,MAX_SOCKS_ADDR_LEN);
+                 len+1,MAX_SOCKS_ADDR_LEN);
             return -1;
           }
           memcpy(req->address,buf->cur+5,len);
@@ -1013,7 +1015,7 @@
           req->command != SOCKS_COMMAND_RESOLVE) {
         /* not a connect or resolve? we don't support it. */
         warn(LD_APP,"socks4: command %d not recognized. Rejecting.",
-               req->command);
+             req->command);
         return -1;
       }
 
@@ -1029,7 +1031,7 @@
         tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
         if (strlen(tmpbuf)+1 > MAX_SOCKS_ADDR_LEN) {
           debug(LD_APP,"socks4 addr (%d bytes) too long. Rejecting.",
-                 (int)strlen(tmpbuf));
+                (int)strlen(tmpbuf));
           return -1;
         }
         debug(LD_APP,"socks4: successfully read destip (%s)", safe_str(tmpbuf));
@@ -1112,7 +1114,7 @@
       /* fall through */
     default: /* version is not socks4 or socks5 */
       warn(LD_APP,"Socks version %d not recognized. (Tor is not an http proxy.)",
-             *(buf->cur));
+           *(buf->cur));
       return -1;
   }
 }

Index: circuitbuild.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -d -r1.172 -r1.173
--- circuitbuild.c	10 Dec 2005 08:26:54 -0000	1.172
+++ circuitbuild.c	10 Dec 2005 09:36:25 -0000	1.173
@@ -338,7 +338,7 @@
   in.s_addr = htonl(firsthop->extend_info->addr);
   tor_inet_ntoa(&in, tmpbuf, sizeof(tmpbuf));
   debug(LD_CIRC,"Looking for firsthop '%s:%u'",tmpbuf,
-         firsthop->extend_info->port);
+        firsthop->extend_info->port);
   /* imprint the circuit with its future n_conn->id */
   memcpy(circ->n_conn_id_digest, firsthop->extend_info->identity_digest,
          DIGEST_LEN);
@@ -391,7 +391,7 @@
   extern smartlist_t *circuits_pending_or_conns;
 
   debug(LD_CIRC,"or_conn to %s, status=%d",
-         or_conn->nickname ? or_conn->nickname : "NULL", status);
+        or_conn->nickname ? or_conn->nickname : "NULL", status);
 
   if (!circuits_pending_or_conns)
     return;
@@ -656,7 +656,9 @@
   relay_header_unpack(&rh, cell->payload);
 
   if (rh.length < 4+2+ONIONSKIN_CHALLENGE_LEN+DIGEST_LEN) {
-    log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,"Wrong length %d on extend cell. Closing circuit.", rh.length);
+    log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+           "Wrong length %d on extend cell. Closing circuit.",
+           rh.length);
     return -1;
   }
 
@@ -678,7 +680,7 @@
     in.s_addr = htonl(circ->n_addr);
     tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
     info(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
-           tmpbuf, circ->n_port);
+         tmpbuf, circ->n_port);
 
     circ->onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN);
     memcpy(circ->onionskin, onionskin, ONIONSKIN_CHALLENGE_LEN);
@@ -910,7 +912,7 @@
          cell_type == CELL_CREATED ? ONIONSKIN_REPLY_LEN : DIGEST_LEN*2);
 
   debug(LD_CIRC,"init digest forward 0x%.8x, backward 0x%.8x.",
-         (unsigned int)*(uint32_t*)(keys), (unsigned int)*(uint32_t*)(keys+20));
+        (unsigned int)*(uint32_t*)(keys), (unsigned int)*(uint32_t*)(keys+20));
   if (circuit_init_cpath_crypto(tmp_cpath, keys, 0)<0) {
     warn(LD_BUG,"Circuit initialization failed");
     tor_free(tmp_cpath);
@@ -969,19 +971,19 @@
     routelen++;
 #endif
   debug(LD_CIRC,"Chosen route length %d (%d routers available).",routelen,
-         smartlist_len(routers));
+        smartlist_len(routers));
 
   num_acceptable_routers = count_acceptable_routers(routers);
 
   if (num_acceptable_routers < 2) {
     info(LD_CIRC,"Not enough acceptable routers (%d). Discarding this circuit.",
-           num_acceptable_routers);
+         num_acceptable_routers);
     return -1;
   }
 
   if (num_acceptable_routers < routelen) {
     info(LD_CIRC,"Not enough routers: cutting routelen from %d to %d.",
-           routelen, num_acceptable_routers);
+         routelen, num_acceptable_routers);
     routelen = num_acceptable_routers;
   }
 
@@ -1184,7 +1186,7 @@
     }
   }
   info(LD_CIRC, "Found %d servers that might support %d/%d pending connections.",
-         n_best_support, best_support, n_pending_connections);
+       n_best_support, best_support, n_pending_connections);
 
   preferredexits = smartlist_create();
   add_nickname_list_to_smartlist(preferredexits,options->ExitNodes,1,1);
@@ -1216,8 +1218,8 @@
     if (best_support == -1) {
       if (need_uptime || need_capacity) {
         info(LD_CIRC, "We couldn't find any live%s%s routers; falling back to list of all routers.",
-               need_capacity?", fast":"",
-               need_uptime?", stable":"");
+             need_capacity?", fast":"",
+             need_uptime?", stable":"");
         return choose_good_exit_server_general(dir, 0, 0);
       }
       notice(LD_CIRC, "All routers are down or middleman -- choosing a doomed exit at random.");
@@ -1358,7 +1360,7 @@
   circuit_set_state(circ, CIRCUIT_STATE_BUILDING);
   if (circuit_send_next_onion_skin(circ)<0) {
     warn(LD_CIRC, "Couldn't extend circuit to new point '%s'.",
-           info->nickname);
+         info->nickname);
     circuit_mark_for_close(circ);
     return -1;
   }
@@ -1540,12 +1542,12 @@
 
   if (cur_len >= state->desired_path_len) {
     debug(LD_CIRC, "Path is complete: %d steps long",
-           state->desired_path_len);
+          state->desired_path_len);
     return 1;
   }
 
   debug(LD_CIRC, "Path is %d long; we want %d", cur_len,
-         state->desired_path_len);
+        state->desired_path_len);
 
   if (cur_len == state->desired_path_len - 1) { /* Picking last node */
     info = extend_info_dup(state->chosen_exit);
@@ -1566,7 +1568,7 @@
   }
 
   debug(LD_CIRC,"Chose router %s for hop %d (exit is %s)",
-         info->nickname, cur_len+1, build_state_get_exit_nickname(state));
+        info->nickname, cur_len+1, build_state_get_exit_nickname(state));
 
   onion_append_hop(head_ptr, info);
   extend_info_free(info);
@@ -1754,7 +1756,7 @@
       base16_encode(dbuf, sizeof(dbuf), helper->identity, DIGEST_LEN);
       format_local_iso_time(tbuf, since);
       warn(LD_CIRC, "Helper node '%s' (%s) has been %s since %s; removing.",
-             helper->nickname, dbuf, why, tbuf);
+           helper->nickname, dbuf, why, tbuf);
       tor_free(helper);
       smartlist_del(helper_nodes, i);
       helper_nodes_changed();
@@ -1796,13 +1798,13 @@
           helper->unlisted_since = time(NULL);
           ++changed;
           warn(LD_CIRC,"Helper node '%s' is not listed by directories",
-                 helper->nickname);
+               helper->nickname);
           severity = LOG_WARN;
         }
       } else {
         if (helper->unlisted_since) {
           warn(LD_CIRC,"Helper node '%s' is listed again by directories",
-                 helper->nickname);
+               helper->nickname);
           ++changed;
           severity = LOG_WARN;
         }
@@ -1852,17 +1854,17 @@
           if (helper->down_since) {
             /*XXXX shouldn't warn. NM */
             warn(LD_CIRC,
-                   "Connection to formerly down helper node '%s' succeeded. "
-                   "%d/%d helpers usable.", helper->nickname,
-                   num_live_helpers(), smartlist_len(helper_nodes));
+                 "Connection to formerly down helper node '%s' succeeded. "
+                 "%d/%d helpers usable.", helper->nickname,
+                 num_live_helpers(), smartlist_len(helper_nodes));
             helper_nodes_changed();
           }
           helper->down_since = 0;
         } else if (!helper->down_since) {
           helper->down_since = time(NULL);
           warn(LD_CIRC,
-                 "Connection to helper node '%s' failed. %d/%d helpers usable.",
-                 helper->nickname, num_live_helpers(), smartlist_len(helper_nodes));
+               "Connection to helper node '%s' failed. %d/%d helpers usable.",
+               helper->nickname, num_live_helpers(), smartlist_len(helper_nodes));
           helper_nodes_changed();
         }
       }

Index: circuitlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitlist.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- circuitlist.c	8 Dec 2005 19:46:22 -0000	1.84
+++ circuitlist.c	10 Dec 2005 09:36:25 -0000	1.85
@@ -559,7 +559,8 @@
   circuit_t *circ;
   circuit_t *best=NULL;
 
-  debug(LD_CIRC,"Hunting for a circ to cannibalize: purpose %d, uptime %d, capacity %d, internal %d", purpose, need_uptime, need_capacity, internal);
+  debug(LD_CIRC,"Hunting for a circ to cannibalize: purpose %d, uptime %d, capacity %d, internal %d",
+         purpose, need_uptime, need_capacity, internal);
 
   for (circ=global_circuitlist; circ; circ = circ->next) {
     if (CIRCUIT_IS_ORIGIN(circ) &&
@@ -682,8 +683,8 @@
     tor_assert(circ->build_state->chosen_exit);
     /* treat this like getting a nack from it */
     info(LD_REND,"Failed intro circ %s to %s (awaiting ack). Removing from descriptor.",
-           safe_str(circ->rend_query),
-           safe_str(build_state_get_exit_nickname(circ->build_state)));
+         safe_str(circ->rend_query),
+         safe_str(build_state_get_exit_nickname(circ->build_state)));
     rend_client_remove_intro_point(circ->build_state->chosen_exit,
                                    circ->rend_query);
   }

Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- circuituse.c	5 Dec 2005 19:45:54 -0000	1.101
+++ circuituse.c	10 Dec 2005 09:36:25 -0000	1.102
@@ -372,7 +372,7 @@
   if (!circuit_all_predicted_ports_handled(now, &port_needs_uptime,
                                            &port_needs_capacity)) {
     info(LD_CIRC,"Have %d clean circs (%d internal), need another exit circ.",
-      num, num_internal);
+         num, num_internal);
     circuit_launch_by_router(CIRCUIT_PURPOSE_C_GENERAL, NULL,
                              port_needs_uptime, port_needs_capacity, 0);
     return;
@@ -381,7 +381,7 @@
   /* Third, see if we need any more hidden service (server) circuits. */
   if (num_rend_services() && num_uptime_internal < 3) {
     info(LD_CIRC,"Have %d clean circs (%d internal), need another internal circ for my hidden service.",
-           num, num_internal);
+         num, num_internal);
     circuit_launch_by_router(CIRCUIT_PURPOSE_C_GENERAL, NULL,
                              1, 1, 1);
     return;
@@ -393,7 +393,7 @@
       ((num_uptime_internal<2 && hidserv_needs_uptime) ||
         num_internal<2)) {
     info(LD_CIRC,"Have %d clean circs (%d uptime-internal, %d internal),"
-      " need another hidserv circ.", num, num_uptime_internal, num_internal);
+         " need another hidserv circ.", num, num_uptime_internal, num_internal);
     circuit_launch_by_router(CIRCUIT_PURPOSE_C_GENERAL, NULL,
                              hidserv_needs_uptime, hidserv_needs_capacity, 1);
     return;
@@ -569,7 +569,7 @@
 #define CIRCUIT_UNUSED_CIRC_TIMEOUT 3600 /* an hour */
       if (circ->timestamp_created + CIRCUIT_UNUSED_CIRC_TIMEOUT < now) {
         debug(LD_CIRC,"Closing circuit that has been unused for %d seconds.",
-               (int)(now - circ->timestamp_created));
+              (int)(now - circ->timestamp_created));
         circuit_mark_for_close(circ);
       }
     }
@@ -771,7 +771,7 @@
                                        need_uptime, need_capacity, internal);
     if (circ) {
       info(LD_CIRC,"Cannibalizing circ '%s' for purpose %d",
-             build_state_get_exit_nickname(circ->build_state), purpose);
+           build_state_get_exit_nickname(circ->build_state), purpose);
       circ->purpose = purpose;
       /* reset the birth date of this circ, else expire_building
        * will see it and think it's been trying to build since it
@@ -1129,12 +1129,12 @@
       routerinfo_t *router = router_get_by_nickname(conn->chosen_exit_name, 1);
       if (!router) {
         warn(LD_APP,"Requested exit point '%s' is not known. Closing.",
-               conn->chosen_exit_name);
+             conn->chosen_exit_name);
         return -1;
       }
       if (!connection_ap_can_use_exit(conn, router)) {
         warn(LD_APP, "Requested exit point '%s' would refuse request. Closing.",
-               conn->chosen_exit_name);
+             conn->chosen_exit_name);
         return -1;
       }
     }
@@ -1145,7 +1145,7 @@
       return retval;
 
     debug(LD_APP|LD_CIRC,"Attaching apconn to circ %d (stream %d sec old).",
-           circ->n_circ_id, conn_age);
+          circ->n_circ_id, conn_age);
     /* here, print the circ's path. so people can figure out which circs are sucking. */
     circuit_log_path(LOG_INFO,LD_APP|LD_CIRC,circ);
 
@@ -1181,7 +1181,10 @@
     }
 
     if (rendcirc && rendcirc->purpose == CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED) {
-      info(LD_REND,"pending-join circ %d already here, with intro ack. Stalling. (stream %d sec old)", rendcirc->n_circ_id, conn_age);
+      info(LD_REND,
+           "pending-join circ %d already here, with intro ack. "
+           "Stalling. (stream %d sec old)",
+            rendcirc->n_circ_id, conn_age);
       return 0;
     }
 
@@ -1202,12 +1205,12 @@
 
     if (rendcirc && introcirc && rendcirc->purpose == CIRCUIT_PURPOSE_C_REND_READY) {
       info(LD_REND,"ready rend circ %d already here (no intro-ack yet on intro %d). (stream %d sec old)",
-             rendcirc->n_circ_id, introcirc->n_circ_id, conn_age);
+           rendcirc->n_circ_id, introcirc->n_circ_id, conn_age);
 
       tor_assert(introcirc->purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
       if (introcirc->state == CIRCUIT_STATE_OPEN) {
         info(LD_REND,"found open intro circ %d (rend %d); sending introduction. (stream %d sec old)",
-               introcirc->n_circ_id, rendcirc->n_circ_id, conn_age);
+             introcirc->n_circ_id, rendcirc->n_circ_id, conn_age);
         if (rend_client_send_introduction(introcirc, rendcirc) < 0) {
           return -1;
         }

Index: command.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/command.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- command.c	8 Dec 2005 17:38:32 -0000	1.103
+++ command.c	10 Dec 2005 09:36:25 -0000	1.104
@@ -82,10 +82,10 @@
   if (now > current_second) { /* the second has rolled over */
     /* print stats */
     info(LD_OR,"At end of second: %d creates (%d ms), %d createds (%d ms), %d relays (%d ms), %d destroys (%d ms)",
-      num_create, create_time/1000,
-      num_created, created_time/1000,
-      num_relay, relay_time/1000,
-      num_destroy, destroy_time/1000);
+         num_create, create_time/1000,
+         num_created, created_time/1000,
+         num_relay, relay_time/1000,
+         num_destroy, destroy_time/1000);
 
     /* zero out stats */
     num_create = num_created = num_relay = num_destroy = 0;
@@ -174,11 +174,11 @@
    */
   if ((cell->circ_id & (1<<15)) && conn->circ_id_type == CIRC_ID_TYPE_HIGHER) {
     info(LD_OR, "Got a high circuit ID from %s (%d); switching to low circuit IDs.",
-           conn->nickname ? conn->nickname : "client", conn->s);
+         conn->nickname ? conn->nickname : "client", conn->s);
     conn->circ_id_type = CIRC_ID_TYPE_LOWER;
   } else if (!(cell->circ_id & (1<<15)) && conn->circ_id_type == CIRC_ID_TYPE_LOWER) {
     info(LD_OR, "Got a low circuit ID from %s (%d); switching to high circuit IDs.",
-           conn->nickname ? conn->nickname : "client", conn->s);
+         conn->nickname ? conn->nickname : "client", conn->s);
     conn->circ_id_type = CIRC_ID_TYPE_HIGHER;
   }
 
@@ -336,7 +336,7 @@
 
   if (!circ) {
     info(LD_OR,"unknown circuit %d on connection from %s:%d. Dropping.",
-           cell->circ_id, conn->address, conn->port);
+         cell->circ_id, conn->address, conn->port);
     return;
   }
   debug(LD_OR,"Received for circID %d.",cell->circ_id);

Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.459
retrieving revision 1.460
diff -u -d -r1.459 -r1.460
--- config.c	10 Dec 2005 08:26:54 -0000	1.459
+++ config.c	10 Dec 2005 09:36:25 -0000	1.460
@@ -486,7 +486,7 @@
   /* Ensure data directory is private; create if possible. */
   if (check_private_dir(options->DataDirectory, CPD_CREATE)<0) {
     err(LD_FS, "Couldn't access/create private data directory \"%s\"",
-           options->DataDirectory);
+        options->DataDirectory);
     /* No need to roll back, since you can't change the value. */
     goto done;
   }
@@ -705,9 +705,9 @@
         (command_line || !fmt->abbrevs[i].commandline_only)) {
       if (warn_obsolete && fmt->abbrevs[i].warn) {
         warn(LD_CONFIG,
-            "The configuration option '%s' is deprecated; use '%s' instead.",
-               fmt->abbrevs[i].abbreviated,
-               fmt->abbrevs[i].full);
+             "The configuration option '%s' is deprecated; use '%s' instead.",
+             fmt->abbrevs[i].abbreviated,
+             fmt->abbrevs[i].full);
       }
       return fmt->abbrevs[i].full;
     }
@@ -740,7 +740,7 @@
     }
     if (i == argc-1) {
       warn(LD_CONFIG,"Command-line option '%s' with no value. Failing.",
-             argv[i]);
+           argv[i]);
       config_free_lines(front);
       return -1;
     }
@@ -867,8 +867,8 @@
   for (i=0; fmt->vars[i].name; ++i) {
     if (!strncasecmp(key, fmt->vars[i].name, keylen)) {
       warn(LD_CONFIG, "The abbreviation '%s' is deprecated. "
-          "Please use '%s' instead",
-             key, fmt->vars[i].name);
+           "Please use '%s' instead",
+           key, fmt->vars[i].name);
       return &fmt->vars[i];
     }
   }
@@ -1099,7 +1099,7 @@
     return NULL;
   } else if (var->type == CONFIG_TYPE_LINELIST_S) {
     warn(LD_CONFIG,
-           "Can't return context-sensitive '%s' on its own", key);
+         "Can't return context-sensitive '%s' on its own", key);
     return NULL;
   }
   value = ((char*)options) + var->var_offset;
@@ -2524,7 +2524,7 @@
       levelMin = parse_log_level(tmp_sev);
       if (levelMin < 0) {
         warn(LD_CONFIG, "Unrecognized log severity '%s': must be one of "
-               "err|warn|notice|info|debug", tmp_sev);
+             "err|warn|notice|info|debug", tmp_sev);
         tor_free(tmp_sev);
         return -1;
       }
@@ -2536,7 +2536,7 @@
       levelMax = parse_log_level(cp+1);
       if (levelMax < 0) {
         warn(LD_CONFIG, "Unrecognized log severity '%s': must be one of "
-               "err|warn|notice|info|debug", cp+1);
+             "err|warn|notice|info|debug", cp+1);
         return -1;
       }
     }
@@ -2544,7 +2544,7 @@
     levelMin = parse_log_level(range);
     if (levelMin < 0) {
       warn(LD_CONFIG, "Unrecognized log severity '%s': must be one of "
-             "err|warn|notice|info|debug", range);
+           "err|warn|notice|info|debug", range);
       return -1;
     }
     levelMax = LOG_ERR;
@@ -2581,7 +2581,7 @@
   if (file_opt && !strcasecmp(file_opt->key, "LogFile")) {
     if (add_single_log_option(options, levelMin, levelMax, "file", file_opt->value) < 0) {
       warn(LD_FS, "Cannot write to LogFile \"%s\": %s.", file_opt->value,
-             strerror(errno));
+           strerror(errno));
       return -1;
     }
   } else if (file_opt && !strcasecmp(file_opt->key, "SysLog")) {
@@ -2653,11 +2653,11 @@
 #endif
     } else {
       warn(LD_CONFIG, "Unrecognized log type %s",
-             (const char*)smartlist_get(elts,1));
+           (const char*)smartlist_get(elts,1));
       if (strchr(smartlist_get(elts,1), '/') ||
           strchr(smartlist_get(elts,1), '\\')) {
         warn(LD_CONFIG, "Did you mean to say 'Log file %s' ?",
-               (const char *)smartlist_get(elts,1));
+             (const char *)smartlist_get(elts,1));
       }
       ok = 0; goto cleanup;
     }
@@ -3397,7 +3397,7 @@
   } else if (slow && server) {
     log(LOG_WARN, LD_GENERAL,
         "libevent %s can be very slow with %s. "
-      "When running a server, please use the latest version of libevent.",v,m);
+        "When running a server, please use the latest version of libevent.",v,m);
   }
 
 }

Index: connection.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -d -r1.425 -r1.426
--- connection.c	5 Dec 2005 19:15:27 -0000	1.425
+++ connection.c	10 Dec 2005 09:36:25 -0000	1.426
@@ -322,7 +322,9 @@
 
   if (CONN_IS_EDGE(conn)) {
     if (!conn->has_sent_end) {
-      warn(LD_BUG,"Harmless bug: Edge connection (marked at %s:%d) hasn't sent end yet?", conn->marked_for_close_file, conn->marked_for_close);
+      warn(LD_BUG,
+           "Harmless bug: Edge connection (marked at %s:%d) hasn't sent end yet?",
+           conn->marked_for_close_file, conn->marked_for_close);
       tor_fragile_assert();
     }
   }
@@ -367,7 +369,7 @@
         /* since conn gets removed right after this function finishes,
          * there's no point trying to send back a reply at this point. */
         warn(LD_BUG,"Bug: Closing stream (marked at %s:%d) without sending back a socks reply.",
-               conn->marked_for_close_file, conn->marked_for_close);
+             conn->marked_for_close_file, conn->marked_for_close);
       } else {
         control_event_stream_status(conn, STREAM_EVENT_CLOSED);
       }
@@ -403,9 +405,9 @@
   }
   if (conn->outbuf_flushlen) {
     info(LD_NET,"fd %d, type %s, state %s, %d bytes on outbuf.",
-           conn->s, conn_type_to_string(conn->type),
-           conn_state_to_string(conn->type, conn->state),
-           (int)conn->outbuf_flushlen);
+         conn->s, conn_type_to_string(conn->type),
+         conn_state_to_string(conn->type, conn->state),
+         (int)conn->outbuf_flushlen);
   }
 
   connection_unregister(conn);
@@ -540,13 +542,13 @@
 
   if (bind(s,(struct sockaddr *)&listenaddr,sizeof(listenaddr)) < 0) {
     warn(LD_NET, "Could not bind to %s:%u: %s", address, usePort,
-           tor_socket_strerror(tor_socket_errno(s)));
+         tor_socket_strerror(tor_socket_errno(s)));
     goto err;
   }
 
   if (listen(s,SOMAXCONN) < 0) {
     warn(LD_NET, "Could not listen on %s:%u: %s", address, usePort,
-           tor_socket_strerror(tor_socket_errno(s)));
+         tor_socket_strerror(tor_socket_errno(s)));
     goto err;
   }
 
@@ -638,7 +640,7 @@
     }
     /* else there was a real error. */
     warn(LD_NET,"accept() failed: %s. Closing listener.",
-           tor_socket_strerror(e));
+         tor_socket_strerror(e));
     connection_mark_for_close(conn);
     return -1;
   }
@@ -748,12 +750,12 @@
   s = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
   if (s < 0) {
     warn(LD_NET,"Error creating network socket: %s",
-           tor_socket_strerror(tor_socket_errno(-1)));
+         tor_socket_strerror(tor_socket_errno(-1)));
     return -1;
   } else if (!SOCKET_IS_POLLABLE(s)) {
     warn(LD_NET,
-      "Too many connections; can't create pollable connection to %s",
-      safe_str(address));
+         "Too many connections; can't create pollable connection to %s",
+         safe_str(address));
     tor_close_socket(s);
     return -1;
   }
@@ -766,11 +768,11 @@
     ext_addr.sin_port = 0;
     if (!tor_inet_aton(options->OutboundBindAddress, &ext_addr.sin_addr)) {
       warn(LD_CONFIG,"Outbound bind address '%s' didn't parse. Ignoring.",
-             options->OutboundBindAddress);
+           options->OutboundBindAddress);
     } else {
       if (bind(s, (struct sockaddr*)&ext_addr, sizeof(ext_addr)) < 0) {
         warn(LD_NET,"Error binding network socket: %s",
-               tor_socket_strerror(tor_socket_errno(s)));
+             tor_socket_strerror(tor_socket_errno(s)));
         return -1;
       }
     }
@@ -790,7 +792,7 @@
     if (!ERRNO_IS_CONN_EINPROGRESS(e)) {
       /* yuck. kill it. */
       info(LD_NET,"connect() to %s:%u failed: %s",safe_str(address),port,
-             tor_socket_strerror(e));
+           tor_socket_strerror(e));
       tor_close_socket(s);
       return -1;
     } else {
@@ -1232,7 +1234,7 @@
     }
 
     debug(LD_NET,"%d: starting, inbuf_datalen %d (%d pending in tls object). at_most %d.",
-           conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls), at_most);
+          conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls), at_most);
 
     /* else open, or closing */
     result = read_to_buf_tls(conn->tls, at_most, conn->inbuf);
@@ -1240,11 +1242,11 @@
     switch (result) {
       case TOR_TLS_CLOSE:
         info(LD_NET,"TLS connection closed on read. Closing. (Nickname %s, address %s",
-               conn->nickname ? conn->nickname : "not set", conn->address);
+             conn->nickname ? conn->nickname : "not set", conn->address);
         return -1;
       case TOR_TLS_ERROR:
         info(LD_NET,"tls error. breaking (nickname %s, address %s).",
-               conn->nickname ? conn->nickname : "not set", conn->address);
+             conn->nickname ? conn->nickname : "not set", conn->address);
         return -1;
       case TOR_TLS_WANTWRITE:
         connection_start_writing(conn);
@@ -1413,7 +1415,7 @@
       case TOR_TLS_ERROR:
       case TOR_TLS_CLOSE:
         info(LD_NET,result==TOR_TLS_ERROR?
-               "tls error. breaking.":"TLS connection closed on flush");
+             "tls error. breaking.":"TLS connection closed on flush");
         connection_close_immediate(conn); /* Don't flush; connection is dead. */
         connection_mark_for_close(conn);
         return -1;

Index: connection_edge.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.374
retrieving revision 1.375
diff -u -d -r1.374 -r1.375
--- connection_edge.c	7 Dec 2005 04:43:39 -0000	1.374
+++ connection_edge.c	10 Dec 2005 09:36:25 -0000	1.375
@@ -126,7 +126,7 @@
     case AP_CONN_STATE_RESOLVE_WAIT:
     case AP_CONN_STATE_CONTROLLER_WAIT:
       info(LD_EDGE,"data from edge while in '%s' state. Leaving it on buffer.",
-             conn_state_to_string(conn->type, conn->state));
+           conn_state_to_string(conn->type, conn->state));
       return 0;
   }
   warn(LD_BUG,"Bug: Got unexpected state %d. Closing.",conn->state);
@@ -183,7 +183,7 @@
 
   if (conn->marked_for_close) {
     warn(LD_BUG,"Bug: called on conn that's already marked for close at %s:%d.",
-           conn->marked_for_close_file, conn->marked_for_close);
+         conn->marked_for_close_file, conn->marked_for_close);
     return 0;
   }
 
@@ -274,7 +274,7 @@
   in.s_addr = htonl(conn->addr);
   tor_inet_ntoa(&in,valbuf,sizeof(valbuf));
   info(LD_EXIT,"Exit connection to %s:%u (%s) established.",
-         safe_str(conn->address),conn->port,safe_str(valbuf));
+       safe_str(conn->address),conn->port,safe_str(valbuf));
 
   conn->state = EXIT_CONN_STATE_OPEN;
   connection_watch_events(conn, EV_READ); /* stop writing, continue reading */
@@ -341,7 +341,7 @@
     circ = circuit_get_by_edge_conn(conn);
     if (!circ) { /* it's vanished? */
       info(LD_APP,"Conn is waiting (address %s), but lost its circ.",
-             safe_str(conn->socks_request->address));
+           safe_str(conn->socks_request->address));
       connection_mark_unattached_ap(conn, END_STREAM_REASON_TIMEOUT);
       continue;
     }
@@ -588,7 +588,7 @@
     strlcpy(address, ent->new_address, maxlen);
   }
   warn(LD_CONFIG,"Loop detected: we've rewritten '%s' 16 times! Using it as-is.",
-         safe_str(address));
+       safe_str(address));
   /* it's fine to rewrite a rewrite, but don't loop forever */
 }
 
@@ -668,7 +668,7 @@
   }
   ++ent->num_resolve_failures;
   info(LD_APP, "Address %s now has %d resolve failures.",
-         safe_str(address), ent->num_resolve_failures);
+       safe_str(address), ent->num_resolve_failures);
   return ent->num_resolve_failures;
 }
 
@@ -960,7 +960,7 @@
 
   tor_strlower(socks->address); /* normalize it */
   debug(LD_APP,"Client asked for %s:%d", safe_str(socks->address),
-         socks->port);
+        socks->port);
 
   /* For address map controls, remap the address */
   addressmap_rewrite(socks->address, sizeof(socks->address));
@@ -973,7 +973,7 @@
      * information.
      */
     warn(LD_APP,"Missing mapping for virtual address '%s'. Refusing.",
-           socks->address); /* don't safe_str() this yet. */
+         socks->address); /* don't safe_str() this yet. */
     connection_mark_unattached_ap(conn, END_STREAM_REASON_INTERNAL);
     return -1;
   }
@@ -1029,7 +1029,7 @@
     if (tor_should_handle_stream &&
         address_is_invalid_destination(socks->address)) {
       warn(LD_APP,"Destination '%s' seems to be an invalid hostname. Failing.",
-             safe_str(socks->address));
+           safe_str(socks->address));
       connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
       return -1;
     }
@@ -1066,7 +1066,7 @@
           router_find_exact_exit_enclave(socks->address, socks->port);
         if (r) {
           info(LD_APP,"Redirecting address %s to exit at enclave router %s",
-                 safe_str(socks->address), r->nickname);
+               safe_str(socks->address), r->nickname);
           /* use the hex digest, not nickname, in case there are two
              routers with this nickname */
           conn->chosen_exit_name =
@@ -1103,19 +1103,19 @@
 
     strlcpy(conn->rend_query, socks->address, sizeof(conn->rend_query));
     info(LD_REND,"Got a hidden service request for ID '%s'",
-           safe_str(conn->rend_query));
+         safe_str(conn->rend_query));
     /* see if we already have it cached */
     r = rend_cache_lookup_entry(conn->rend_query, -1, &entry);
     if (r<0) {
       warn(LD_REND,"Invalid service descriptor %s",
-             safe_str(conn->rend_query));
+           safe_str(conn->rend_query));
       connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
       return -1;
     }
     if (r==0) {
       conn->state = AP_CONN_STATE_RENDDESC_WAIT;
       info(LD_REND, "Unknown descriptor %s. Fetching.",
-             safe_str(conn->rend_query));
+           safe_str(conn->rend_query));
       rend_client_refetch_renddesc(conn->rend_query);
     } else { /* r > 0 */
 #define NUM_SECONDS_BEFORE_REFETCH (60*15)
@@ -1243,7 +1243,7 @@
 
   ap_conn->state = AP_CONN_STATE_RESOLVE_WAIT;
   info(LD_APP,"Address sent for resolve, ap socket %d, n_circ_id %d",
-         ap_conn->s, circ->n_circ_id);
+       ap_conn->s, circ->n_circ_id);
   control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE);
   return 0;
 }
@@ -1265,7 +1265,7 @@
 
   if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) < 0) {
     warn(LD_NET,"Couldn't construct socketpair (%s). Network down? Delaying.",
-        tor_socket_strerror(-err));
+         tor_socket_strerror(-err));
     return -1;
   }
 
@@ -1607,7 +1607,7 @@
   if (!connection_edge_is_rendezvous_stream(conn) &&
       router_compare_to_my_exit_policy(conn)) {
     info(LD_EXIT,"%s:%d failed exit policy. Closing.",
-           safe_str(conn->address), conn->port);
+         safe_str(conn->address), conn->port);
     connection_edge_end(conn, END_STREAM_REASON_EXITPOLICY, conn->cpath_layer);
     circuit_detach_stream(circuit_get_by_edge_conn(conn), conn);
     connection_free(conn);
@@ -1629,7 +1629,7 @@
           in.s_addr = htonl(addr);
           tor_inet_ntoa(&in, tmpbuf, sizeof(tmpbuf));
           debug(LD_EXIT, "Redirecting connection from %s:%d to %s:%d",
-                 safe_str(conn->address), conn->port, safe_str(tmpbuf), port);
+                safe_str(conn->address), conn->port, safe_str(tmpbuf), port);
         }
         break;
       }
@@ -1716,7 +1716,7 @@
     if (router_get_by_nickname(conn->chosen_exit_name, 1) != exit) {
       /* doesn't match */
       debug(LD_APP,"Requested node '%s', considering node '%s'. No.",
-             conn->chosen_exit_name, exit->nickname);
+            conn->chosen_exit_name, exit->nickname);
       return 0;
     }
   }

Index: connection_or.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_or.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- connection_or.c	5 Dec 2005 19:15:27 -0000	1.200
+++ connection_or.c	10 Dec 2005 09:36:25 -0000	1.201
@@ -189,8 +189,8 @@
   }
   /* else, bad news on the status code */
   warn(LD_OR,
-      "The https proxy sent back an unexpected status code %d (\"%s\"). Closing.",
-      status_code, reason);
+       "The https proxy sent back an unexpected status code %d (\"%s\"). Closing.",
+       status_code, reason);
   tor_free(reason);
   connection_mark_for_close(conn);
   return -1;
@@ -260,7 +260,7 @@
   tor_assert(conn->state == OR_CONN_STATE_CONNECTING);
 
   debug(LD_OR,"OR connect() to router at %s:%u finished.",
-         conn->address,conn->port);
+        conn->address,conn->port);
 
   if (get_options()->HttpsProxy) {
     char buf[1024];
@@ -572,7 +572,7 @@
   }
   check_no_tls_errors();
   debug(LD_OR, "Other side (%s:%d) claims to be router '%s'",
-         conn->address, conn->port, nickname);
+        conn->address, conn->port, nickname);
 
   if (tor_tls_verify(severity, conn->tls, &identity_rcvd) < 0) {
     log_fn(severity,LD_OR,"Other side, which claims to be router '%s' (%s:%d), has a cert but it's invalid. Closing.",
@@ -655,7 +655,7 @@
     connection_t *c;
     if ((c=connection_or_get_by_identity_digest(digest_rcvd))) {
       debug(LD_OR,"Router '%s' is already connected on fd %d. Dropping fd %d.",
-             c->nickname, c->s, conn->s);
+            c->nickname, c->s, conn->s);
       return -1;
     }
 #endif
@@ -710,7 +710,7 @@
       if (!conn->marked_for_close) {
         /* this connection is broken. remove it. */
         warn(LD_BUG,"Bug: unhandled error on write for OR conn (fd %d); removing",
-               conn->s);
+             conn->s);
         tor_fragile_assert();
         conn->has_sent_end = 1; /* otherwise we cry wolf about duplicate close */
         /* XXX do we need a close-immediate here, so we don't try to flush? */
@@ -740,7 +740,7 @@
 
 loop:
   debug(LD_OR,"%d: starting, inbuf_datalen %d (%d pending in tls object).",
-         conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls));
+        conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls));
   if (buf_datalen(conn->inbuf) < CELL_NETWORK_SIZE) /* entire response available? */
     return 0; /* not yet */
 

Index: control.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -d -r1.155 -r1.156
--- control.c	9 Dec 2005 05:37:26 -0000	1.155
+++ control.c	10 Dec 2005 09:36:25 -0000	1.156
@@ -1339,7 +1339,7 @@
           state = "SUCCEEDED"; break;
         default:
           warn(LD_BUG, "Asked for stream in unknown state %d",
-                 conns[i]->state);
+               conns[i]->state);
           continue;
         }
       circ = circuit_get_by_edge_conn(conns[i]);
@@ -2281,7 +2281,7 @@
     case CONTROL0_CMD_EVENT:
     case CONTROL0_CMD_INFOVALUE:
       warn(LD_CONTROL, "Received client-only '%s' command; ignoring.",
-             control_cmd_to_string(command_type));
+           control_cmd_to_string(command_type));
       send_control0_error(conn, ERR_UNRECOGNIZED_TYPE,
                          "Command type only valid from server to tor client");
       break;
@@ -2291,7 +2291,7 @@
       send_control0_error(conn, ERR_SYNTAX, "Bad fragmentation on command.");
     default:
       warn(LD_CONTROL, "Received unrecognized command type %d; ignoring.",
-             (int)command_type);
+           (int)command_type);
       send_control0_error(conn, ERR_UNRECOGNIZED_TYPE,
                          "Unrecognized command type");
       break;

Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.323
retrieving revision 1.324
diff -u -d -r1.323 -r1.324
--- directory.c	10 Dec 2005 08:26:54 -0000	1.323
+++ directory.c	10 Dec 2005 09:36:25 -0000	1.324
@@ -282,16 +282,16 @@
   if (conn->purpose == DIR_PURPOSE_FETCH_DIR ||
       conn->purpose == DIR_PURPOSE_FETCH_RUNNING_LIST) {
     info(LD_DIR, "Giving up on directory server at '%s:%d'; retrying",
-           conn->address, conn->port);
+         conn->address, conn->port);
     directory_get_from_dirserver(conn->purpose, NULL,
                                  0 /* don't retry_if_no_servers */);
   } else if (conn->purpose == DIR_PURPOSE_FETCH_NETWORKSTATUS) {
     info(LD_DIR, "Giving up on directory server at '%s'; retrying",
-           conn->address);
+         conn->address);
     connection_dir_download_networkstatus_failed(conn);
   } else if (conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC) {
     info(LD_DIR, "Giving up on directory server at '%s'; retrying",
-           conn->address);
+         conn->address);
     connection_dir_download_routerdesc_failed(conn);
   }
 }
@@ -501,7 +501,7 @@
       tor_assert(!resource);
       tor_assert(!payload);
       debug(LD_DIR, "Asking for compressed directory from server running %s",
-             platform?platform:"<unknown version>");
+            platform?platform:"<unknown version>");
       httpcommand = "GET";
       url = tor_strdup("/tor/dir.z");
       break;
@@ -815,7 +815,8 @@
                               &body, &body_len, MAX_DIR_SIZE,
                               allow_partial)) {
     case -1: /* overflow */
-      warn(LD_PROTOCOL,"'fetch' response too large (server '%s:%d'). Closing.", conn->address, conn->port);
+      warn(LD_PROTOCOL,"'fetch' response too large (server '%s:%d'). Closing.",
+           conn->address, conn->port);
       return -1;
     case 0:
       info(LD_HTTP,"'fetch' response not all here, but we're at eof. Closing.");
@@ -825,7 +826,8 @@
 
   if (parse_http_response(headers, &status_code, &date_header,
                           &compression, &reason) < 0) {
-    warn(LD_HTTP,"Unparseable headers (server '%s:%d'). Closing.", conn->address, conn->port);
+    warn(LD_HTTP,"Unparseable headers (server '%s:%d'). Closing.",
+         conn->address, conn->port);
     tor_free(body); tor_free(headers);
     return -1;
   }
@@ -877,9 +879,9 @@
         description2 = "uncompressed";
 
       info(LD_HTTP, "HTTP body from server '%s:%d' was labeled %s, "
-             "but it seems to be %s.%s",
-             conn->address, conn->port, description1, description2,
-             (compression>0 && guessed>0)?"  Trying both.":"");
+           "but it seems to be %s.%s",
+           conn->address, conn->port, description1, description2,
+           (compression>0 && guessed>0)?"  Trying both.":"");
     }
     /* Try declared compression first if we can. */
     if (compression > 0)
@@ -908,16 +910,16 @@
   if (conn->purpose == DIR_PURPOSE_FETCH_DIR) {
     /* fetch/process the directory to learn about new routers. */
     info(LD_DIR,"Received directory (size %d) from server '%s:%d'",
-           (int)body_len, conn->address, conn->port);
+         (int)body_len, conn->address, conn->port);
     if (status_code == 503 || body_len == 0) {
       info(LD_DIR,"Empty directory; status %d (\"%s\") Ignoring.",
-             status_code, reason);
+           status_code, reason);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
     if (status_code != 200) {
       warn(LD_DIR,"Received http status code %d (\"%s\") from server '%s:%d'. I'll try again soon.",
-             status_code, reason, conn->address, conn->port);
+           status_code, reason, conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -931,13 +933,13 @@
     info(LD_DIR,"Received running-routers list (size %d)", (int)body_len);
     if (status_code != 200) {
       warn(LD_DIR,"Received http status code %d (\"%s\") from server '%s:%d'. I'll try again soon.",
-             status_code, reason, conn->address, conn->port);
+           status_code, reason, conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
     if (router_parse_runningrouters(body)<0) {
       warn(LD_DIR,"Bad running-routers from server '%s:%d'. I'll try again soon.",
-             conn->address, conn->port);
+           conn->address, conn->port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -949,8 +951,8 @@
     info(LD_DIR,"Received networkstatus objects (size %d) from server '%s:%d'",(int) body_len, conn->address, conn->port);
     if (status_code != 200) {
       warn(LD_DIR,"Received http status code %d (\"%s\") from server '%s:%d' while fetching \"/tor/status/%s\". I'll try again soon.",
-             status_code, reason, conn->address, conn->port,
-             conn->requested_resource);
+           status_code, reason, conn->address, conn->port,
+           conn->requested_resource);
       tor_free(body); tor_free(headers); tor_free(reason);
       connection_dir_download_networkstatus_failed(conn);
       return -1;
@@ -991,7 +993,7 @@
     smartlist_t *which = NULL;
     int n_asked_for = 0;
     info(LD_DIR,"Received server info (size %d) from server '%s:%d'",
-           (int)body_len, conn->address, conn->port);
+         (int)body_len, conn->address, conn->port);
     if (conn->requested_resource &&
         !strcmpstart(conn->requested_resource,"fp/")) {
       which = smartlist_create();
@@ -1031,8 +1033,8 @@
     }
     if (which) { /* mark remaining ones as failed */
       info(LD_DIR, "Received %d/%d routers requested from %s:%d",
-             n_asked_for-smartlist_len(which), n_asked_for,
-             conn->address, (int)conn->port);
+           n_asked_for-smartlist_len(which), n_asked_for,
+           conn->address, (int)conn->port);
       if (smartlist_len(which)) {
         dir_routerdesc_download_failed(which);
       }
@@ -1067,7 +1069,8 @@
              "tor-doc-server.html", reason, conn->address, conn->port);
         break;
       default:
-        warn(LD_GENERAL,"http status %d (\"%s\") reason unexpected (server '%s:%d').", status_code, reason, conn->address, conn->port);
+        warn(LD_GENERAL,"http status %d (\"%s\") reason unexpected (server '%s:%d').",
+             status_code, reason, conn->address, conn->port);
         break;
     }
     /* return 0 in all cases, since we don't want to mark any
@@ -1076,7 +1079,7 @@
 
   if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC) {
     info(LD_REND,"Received rendezvous descriptor (size %d, status %d (\"%s\"))",
-           (int)body_len, status_code, reason);
+         (int)body_len, status_code, reason);
     switch (status_code) {
       case 200:
         if (rend_cache_store(body, body_len) < 0) {
@@ -1097,7 +1100,8 @@
         warn(LD_REND,"http status 400 (\"%s\"). Dirserver didn't like our rendezvous query?", reason);
         break;
       default:
-        warn(LD_REND,"http status %d (\"%s\") response unexpected (server '%s:%d').", status_code, reason, conn->address, conn->port);
+        warn(LD_REND,"http status %d (\"%s\") response unexpected (server '%s:%d').",
+             status_code, reason, conn->address, conn->port);
         break;
     }
   }
@@ -1261,11 +1265,13 @@
     debug(LD_DIRSERV,"Dumping %sdirectory to client.",
           deflated?"deflated ":"");
     format_rfc1123_time(date, time(NULL));
-    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
-             date,
-             (int)dlen,
-             deflated?"application/octet-stream":"text/plain",
-             deflated?"deflate":"identity");
+    tor_snprintf(tmp, sizeof(tmp),
+                 "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+                 "Content-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
+                 date,
+                 (int)dlen,
+                 deflated?"application/octet-stream":"text/plain",
+                 deflated?"deflate":"identity");
     connection_write_to_buf(tmp, strlen(tmp), conn);
     connection_write_to_buf(cp, dlen, conn);
     return 0;
@@ -1285,7 +1291,9 @@
     }
 
     format_rfc1123_time(date, time(NULL));
-    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
+    tor_snprintf(tmp, sizeof(tmp),
+                 "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+                 "Content-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
                  date,
                  (int)dlen,
                  deflated?"application/octet-stream":"text/plain",
@@ -1317,7 +1325,9 @@
     SMARTLIST_FOREACH(dir_objs, cached_dir_t *, d,
                       dlen += deflated?d->dir_z_len:d->dir_len);
     format_rfc1123_time(date, time(NULL));
-    tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
+    tor_snprintf(tmp, sizeof(tmp),
+                 "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+                 "Content-Type: %s\r\nContent-Encoding: %s\r\n\r\n",
                  date,
                  (int)dlen,
                  deflated?"application/octet-stream":"text/plain",
@@ -1374,9 +1384,9 @@
         }
         tor_free(inp);
         tor_snprintf(tmp, sizeof(tmp),
-           "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
-           "Content-Type: application/octet-stream\r\n"
-           "Content-Encoding: deflate\r\n\r\n",
+                     "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+                     "Content-Type: application/octet-stream\r\n"
+                     "Content-Encoding: deflate\r\n\r\n",
                      date,
                      (int)compressed_len);
         connection_write_to_buf(tmp, strlen(tmp), conn);
@@ -1384,8 +1394,8 @@
         tor_free(compressed);
       } else {
         tor_snprintf(tmp, sizeof(tmp),
-           "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
-           "Content-Type: text/plain\r\n\r\n",
+                     "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+                     "Content-Type: text/plain\r\n\r\n",
                      date,
                      (int)len);
         connection_write_to_buf(tmp, strlen(tmp), conn);
@@ -1420,10 +1430,13 @@
     switch (rend_cache_lookup_desc(query, versioned?-1:0, &descp, &desc_len)) {
       case 1: /* valid */
         format_rfc1123_time(date, time(NULL));
-        tor_snprintf(tmp, sizeof(tmp), "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\nContent-Type: application/octet-stream\r\n\r\n",
-                 date,
-                 (int)desc_len); /* can't include descp here, because it's got nuls */
+        tor_snprintf(tmp, sizeof(tmp),
+                     "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n"
+                     "Content-Type: application/octet-stream\r\n\r\n",
+                     date,
+                     (int)desc_len);
         connection_write_to_buf(tmp, strlen(tmp), conn);
+        /* need to send descp separately, because it may include nuls */
         connection_write_to_buf(descp, desc_len, conn);
         break;
       case 0: /* well-formed but not present */
@@ -1658,13 +1671,13 @@
     }
     if (rs->next_attempt_at == 0)
       debug(LD_DIR, "%s failed %d time(s); I'll try again immediately.",
-             cp, (int)rs->n_download_failures);
+            cp, (int)rs->n_download_failures);
     else if (rs->next_attempt_at < TIME_MAX)
       debug(LD_DIR, "%s failed %d time(s); I'll try again in %d seconds.",
-             cp, (int)rs->n_download_failures, (int)(rs->next_attempt_at-now));
+            cp, (int)rs->n_download_failures, (int)(rs->next_attempt_at-now));
     else
       debug(LD_DIR, "%s failed %d time(s); Giving up for a while.",
-             cp, (int)rs->n_download_failures);
+            cp, (int)rs->n_download_failures);
   });
 
   /* update_router_descriptor_downloads(time(NULL)); */

Index: dirserv.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -d -r1.276 -r1.277
--- dirserv.c	10 Dec 2005 08:26:54 -0000	1.276
+++ dirserv.c	10 Dec 2005 09:36:25 -0000	1.277
@@ -204,8 +204,8 @@
       /* If you approved an OR called "client", then clients who use
        * the default nickname could all be rejected.  That's no good. */
       notice(LD_CONFIG,
-          "Authorizing a nickname '%s' would break many clients; skipping.",
-          DEFAULT_CLIENT_NICKNAME);
+             "Authorizing a nickname '%s' would break many clients; skipping.",
+             DEFAULT_CLIENT_NICKNAME);
       continue;
     }
     if (add_fingerprint_to_dir(nickname, fingerprint, fingerprint_list_new) != 0)
@@ -335,7 +335,9 @@
     return FP_NAMED; /* Right fingerprint. */
   } else {
     if (should_log)
-      warn(LD_DIRSERV,"Mismatched fingerprint for '%s': expected '%s' got '%s'. ContactInfo '%s', platform '%s'.)",
+      warn(LD_DIRSERV,
+           "Mismatched fingerprint for '%s': expected '%s' got '%s'. "
+           "ContactInfo '%s', platform '%s'.)",
            nickname, nn_ent->fingerprint, fp,
            contact ? contact : "",
            platform ? platform : "");
@@ -551,7 +553,7 @@
     switch (r) {
       case FP_REJECT:
         info(LD_DIRSERV, "Router '%s' is now rejected: %s",
-            ent->nickname, msg?msg:"");
+             ent->nickname, msg?msg:"");
         routerlist_remove(rl, ent, i--, 0);
         changed = 1;
         break;
@@ -829,13 +831,13 @@
      overruns.*/
 
   tor_snprintf(buf, buf_len,
-           "signed-directory\n"
-           "published %s\n"
-           "recommended-software %s\n"
-           "router-status %s\n"
-           "dir-signing-key\n%s\n",
-           published, recommended_versions, router_status,
-           identity_pkey);
+               "signed-directory\n"
+               "published %s\n"
+               "recommended-software %s\n"
+               "router-status %s\n"
+               "dir-signing-key\n%s\n",
+               published, recommended_versions, router_status,
+               identity_pkey);
 
   tor_free(recommended_versions);
   tor_free(router_status);

Index: dns.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dns.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- dns.c	3 Dec 2005 02:21:30 -0000	1.176
+++ dns.c	10 Dec 2005 09:36:25 -0000	1.177
@@ -158,7 +158,7 @@
   while (oldest_cached_resolve && (oldest_cached_resolve->expire < now)) {
     resolve = oldest_cached_resolve;
     debug(LD_EXIT,"Forgetting old cached resolve (address %s, expires %lu)",
-        safe_str(resolve->address), (unsigned long)resolve->expire);
+          safe_str(resolve->address), (unsigned long)resolve->expire);
     if (resolve->state == CACHE_STATE_PENDING) {
       debug(LD_EXIT,"Bug: Expiring a dns resolve ('%s') that's still pending. Forgot to cull it?", safe_str(resolve->address));
       tor_fragile_assert();
@@ -292,19 +292,19 @@
         pending_connection->next = resolve->pending_connections;
         resolve->pending_connections = pending_connection;
         debug(LD_EXIT,"Connection (fd %d) waiting for pending DNS resolve of '%s'",
-               exitconn->s, safe_str(exitconn->address));
+              exitconn->s, safe_str(exitconn->address));
         exitconn->state = EXIT_CONN_STATE_RESOLVING;
         return 0;
       case CACHE_STATE_VALID:
         exitconn->addr = resolve->addr;
         debug(LD_EXIT,"Connection (fd %d) found cached answer for '%s'",
-               exitconn->s, safe_str(exitconn->address));
+              exitconn->s, safe_str(exitconn->address));
         if (exitconn->purpose == EXIT_PURPOSE_RESOLVE)
           send_resolved_cell(exitconn, RESOLVED_TYPE_IPV4);
         return 1;
       case CACHE_STATE_FAILED:
         debug(LD_EXIT,"Connection (fd %d) found cached error for '%s'",
-               exitconn->s, safe_str(exitconn->address));
+              exitconn->s, safe_str(exitconn->address));
         if (exitconn->purpose == EXIT_PURPOSE_RESOLVE)
           send_resolved_cell(exitconn, RESOLVED_TYPE_ERROR);
         circ = circuit_get_by_edge_conn(exitconn);
@@ -359,7 +359,8 @@
   }
 
   debug(LD_EXIT,
-    "Connection (fd %d) needs to resolve '%s'; assigning to DNSWorker (fd %d)",
+        "Connection (fd %d) needs to resolve '%s'; assigning "
+        "to DNSWorker (fd %d)",
         exitconn->s, safe_str(exitconn->address), dnsconn->s);
 
   tor_free(dnsconn->address);
@@ -407,7 +408,7 @@
     resolve->pending_connections = pend->next;
     tor_free(pend);
     debug(LD_EXIT, "First connection (fd %d) no longer waiting for resolve of '%s'",
-           conn->s, safe_str(conn->address));
+          conn->s, safe_str(conn->address));
     return;
   } else {
     for ( ; pend->next; pend = pend->next) {
@@ -416,7 +417,7 @@
         pend->next = victim->next;
         tor_free(victim);
         debug(LD_EXIT, "Connection (fd %d) no longer waiting for resolve of '%s'",
-               conn->s, safe_str(conn->address));
+              conn->s, safe_str(conn->address));
         return; /* more are pending */
       }
     }
@@ -485,7 +486,7 @@
   if (!resolve->pending_connections) {
     /* XXX this should never trigger, but sometimes it does */
     warn(LD_BUG,"Bug: Address '%s' is pending but has no pending connections!",
-           safe_str(address));
+         safe_str(address));
     tor_fragile_assert();
     return;
   }
@@ -704,7 +705,7 @@
       connection_fetch_from_buf(&success,1,conn);
       connection_fetch_from_buf((char *)&addr,sizeof(uint32_t),conn);
       warn(LD_EXIT,"Discarding idle dns answer (success %d, addr %d.)",
-             success, addr); // XXX safe_str
+           success, addr); // XXX safe_str
     }
     return 0;
   }
@@ -942,7 +943,7 @@
     /* too many idle? */
     /* cull excess workers */
     info(LD_EXIT,"%d of %d dnsworkers are idle. Killing one.",
-           num_dnsworkers-num_dnsworkers_busy, num_dnsworkers);
+         num_dnsworkers-num_dnsworkers_busy, num_dnsworkers);
     dnsconn = connection_get_by_type_state(CONN_TYPE_DNSWORKER, DNSWORKER_STATE_IDLE);
     tor_assert(dnsconn);
     connection_mark_for_close(dnsconn);

Index: hibernate.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/hibernate.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- hibernate.c	9 Dec 2005 05:37:26 -0000	1.64
+++ hibernate.c	10 Dec 2005 09:36:25 -0000	1.65
@@ -459,9 +459,9 @@
     interval_wakeup_time = interval_start_time;
 
     notice(LD_ACCT, "Configured hibernation.  This interval begins at %s "
-        "and ends at %s.  We have no prior estimate for bandwidth, so "
-        "we will start out awake and hibernate when we exhaust our quota.",
-        buf1, buf2);
+           "and ends at %s.  We have no prior estimate for bandwidth, so "
+           "we will start out awake and hibernate when we exhaust our quota.",
+           buf1, buf2);
     return;
   }
 
@@ -567,12 +567,12 @@
   if (smartlist_len(elts)<1 ||
       atoi(smartlist_get(elts,0)) != BW_ACCOUNTING_VERSION) {
     warn(LD_ACCT, "Unrecognized bw_accounting file version: %s",
-           (const char*)smartlist_get(elts,0));
+         (const char*)smartlist_get(elts,0));
     goto err;
   }
   if (smartlist_len(elts) < 7) {
     warn(LD_ACCT, "Corrupted bw_accounting file: %d lines",
-           smartlist_len(elts));
+         smartlist_len(elts));
     goto err;
   }
   if (parse_iso_time(smartlist_get(elts,1), &t1)) {
@@ -619,12 +619,12 @@
        "this interval.  At the start of the interval, we expected to use "
        "about %lu KB per second. ("U64_FORMAT" bytes read so far, "
        U64_FORMAT" bytes written so far)",
-         (char*)smartlist_get(elts,2),
-         (char*)smartlist_get(elts,1),
-         (unsigned long)n_seconds_active_in_interval,
-         (unsigned long)((uint64_t)expected_bandwidth_usage*1024/60),
-         U64_PRINTF_ARG(n_bytes_read_in_interval),
-         U64_PRINTF_ARG(n_bytes_written_in_interval));
+       (char*)smartlist_get(elts,2),
+       (char*)smartlist_get(elts,1),
+       (unsigned long)n_seconds_active_in_interval,
+       (unsigned long)((uint64_t)expected_bandwidth_usage*1024/60),
+       U64_PRINTF_ARG(n_bytes_read_in_interval),
+       U64_PRINTF_ARG(n_bytes_written_in_interval));
   SMARTLIST_FOREACH(elts, char *, cp, tor_free(cp));
   smartlist_free(elts);
 
@@ -671,8 +671,8 @@
   if (new_state == HIBERNATE_STATE_EXITING &&
       hibernate_state != HIBERNATE_STATE_LIVE) {
     notice(LD_GENERAL,"Sigint received %s; exiting now.",
-        hibernate_state == HIBERNATE_STATE_EXITING ?
-          "a second time" : "while hibernating");
+           hibernate_state == HIBERNATE_STATE_EXITING ?
+           "a second time" : "while hibernating");
     tor_cleanup();
     exit(0);
   }

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.599
retrieving revision 1.600
diff -u -d -r1.599 -r1.600
--- main.c	9 Dec 2005 05:37:26 -0000	1.599
+++ main.c	10 Dec 2005 09:36:25 -0000	1.600
@@ -139,7 +139,7 @@
   nfds++;
 
   debug(LD_NET,"new conn type %s, socket %d, nfds %d.",
-      conn_type_to_string(conn->type), conn->s, nfds);
+        conn_type_to_string(conn->type), conn->s, nfds);
 
   return 0;
 }
@@ -332,7 +332,7 @@
 
   if (event_del(conn->write_event))
     warn(LD_NET, "Error from libevent setting write event state for %d to unwatched.",
-           conn->s);
+         conn->s);
 
 }
 
@@ -345,7 +345,7 @@
 
   if (event_add(conn->write_event, NULL))
     warn(LD_NET, "Error from libevent setting write event state for %d to watched.",
-           conn->s);
+         conn->s);
 }
 
 /** Close all connections that have been scheduled to get closed */
@@ -379,7 +379,7 @@
     if (!conn->marked_for_close) {
 #ifndef MS_WINDOWS
       warn(LD_BUG,"Bug: unhandled error on read for %s connection (fd %d); removing",
-             conn_type_to_string(conn->type), conn->s);
+           conn_type_to_string(conn->type), conn->s);
       tor_fragile_assert();
 #endif
       if (CONN_IS_EDGE(conn))
@@ -448,10 +448,11 @@
     int sz = connection_bucket_write_limit(conn);
     if (!conn->hold_open_until_flushed)
       info(LD_NET,
-        "Conn (addr %s, fd %d, type %s, state %d) marked, but wants to flush %d bytes. "
-        "(Marked at %s:%d)",
-        conn->address, conn->s, conn_type_to_string(conn->type), conn->state,
-        (int)conn->outbuf_flushlen, conn->marked_for_close_file, conn->marked_for_close);
+           "Conn (addr %s, fd %d, type %s, state %d) marked, but wants "
+           "to flush %d bytes. (Marked at %s:%d)",
+           conn->address, conn->s, conn_type_to_string(conn->type), conn->state,
+           (int)conn->outbuf_flushlen,
+            conn->marked_for_close_file, conn->marked_for_close);
     if (connection_speaks_cells(conn)) {
       if (conn->state == OR_CONN_STATE_OPEN) {
         retval = flush_buf_tls(conn->tls, conn->outbuf, sz, &conn->outbuf_flushlen);
@@ -590,7 +591,7 @@
       !conn->marked_for_close &&
       conn->timestamp_lastwritten + 5*60 < now) {
     info(LD_DIR,"Expiring wedged directory conn (fd %d, purpose %d)",
-           conn->s, conn->purpose);
+         conn->s, conn->purpose);
     /* This check is temporary; it's to let us know whether we should consider
      * parsing partial serverdesc responses. */
     if (conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC &&
@@ -643,7 +644,7 @@
                (!router || !server_mode(options) ||
                 !router_is_clique_mode(router))) {
       info(LD_OR,"Expiring non-used OR connection to fd %d (%s:%d) [Not in clique mode].",
-             conn->s,conn->address, conn->port);
+           conn->s,conn->address, conn->port);
       connection_mark_for_close(conn);
       conn->hold_open_until_flushed = 1;
     } else if (
@@ -926,12 +927,12 @@
       warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that "
            "its ORPort is reachable. Please check your firewalls, ports, "
            "address, /etc/hosts file, etc.",
-          me->address, me->or_port);
+           me->address, me->or_port);
     if (me && !check_whether_dirport_reachable())
       warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that its "
            "DirPort is reachable. Please check your firewalls, ports, "
            "address, /etc/hosts file, etc.",
-          me->address, me->dir_port);
+           me->address, me->dir_port);
   }
 
   /* if more than 100s have elapsed, probably the clock jumped: doesn't count. */
@@ -1102,10 +1103,10 @@
       if (e != EINTR && !ERRNO_IS_EINPROGRESS(e)) {
 #ifdef HAVE_EVENT_GET_METHOD
         err(LD_NET,"libevent poll with %s failed: %s [%d]",
-               event_get_method(), tor_socket_strerror(e), e);
+            event_get_method(), tor_socket_strerror(e), e);
 #else
         err(LD_NET,"libevent poll failed: %s [%d]",
-               tor_socket_strerror(e), e);
+            tor_socket_strerror(e), e);
 #endif
         return -1;
 #ifndef MS_WINDOWS
@@ -1249,44 +1250,44 @@
   for (i=0;i<nfds;i++) {
     conn = connection_array[i];
     log(severity, LD_GENERAL, "Conn %d (socket %d) type %d (%s), state %d (%s), created %d secs ago",
-      i, conn->s, conn->type, conn_type_to_string(conn->type),
+        i, conn->s, conn->type, conn_type_to_string(conn->type),
         conn->state, conn_state_to_string(conn->type, conn->state), (int)(now - conn->timestamp_created));
     if (!connection_is_listener(conn)) {
       log(severity,LD_GENERAL,"Conn %d is to '%s:%d'.",i,safe_str(conn->address), conn->port);
       log(severity,LD_GENERAL, "Conn %d: %d bytes waiting on inbuf (len %d, last read %d secs ago)",i,
-             (int)buf_datalen(conn->inbuf),
-             (int)buf_capacity(conn->inbuf),
-             (int)(now - conn->timestamp_lastread));
+          (int)buf_datalen(conn->inbuf),
+          (int)buf_capacity(conn->inbuf),
+          (int)(now - conn->timestamp_lastread));
       log(severity,LD_GENERAL, "Conn %d: %d bytes waiting on outbuf (len %d, last written %d secs ago)",i,
-             (int)buf_datalen(conn->outbuf),
-             (int)buf_capacity(conn->outbuf),
-             (int)(now - conn->timestamp_lastwritten));
+          (int)buf_datalen(conn->outbuf),
+          (int)buf_capacity(conn->outbuf),
+          (int)(now - conn->timestamp_lastwritten));
     }
     circuit_dump_by_conn(conn, severity); /* dump info about all the circuits using this conn */
   }
   log(severity, LD_NET,
-         "Cells processed: %10lu padding\n"
-         "                 %10lu create\n"
-         "                 %10lu created\n"
-         "                 %10lu relay\n"
-         "                        (%10lu relayed)\n"
-         "                        (%10lu delivered)\n"
-         "                 %10lu destroy",
-         stats_n_padding_cells_processed,
-         stats_n_create_cells_processed,
-         stats_n_created_cells_processed,
-         stats_n_relay_cells_processed,
-         stats_n_relay_cells_relayed,
-         stats_n_relay_cells_delivered,
-         stats_n_destroy_cells_processed);
+      "Cells processed: %10lu padding\n"
+      "                 %10lu create\n"
+      "                 %10lu created\n"
+      "                 %10lu relay\n"
+      "                        (%10lu relayed)\n"
+      "                        (%10lu delivered)\n"
+      "                 %10lu destroy",
+      stats_n_padding_cells_processed,
+      stats_n_create_cells_processed,
+      stats_n_created_cells_processed,
+      stats_n_relay_cells_processed,
+      stats_n_relay_cells_relayed,
+      stats_n_relay_cells_delivered,
+      stats_n_destroy_cells_processed);
   if (stats_n_data_cells_packaged)
     log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
-           100*(((double)stats_n_data_bytes_packaged) /
-                (stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
+        100*(((double)stats_n_data_bytes_packaged) /
+             (stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
   if (stats_n_data_cells_received)
     log(severity,LD_NET,"Average delivered cell fullness: %2.3f%%",
-           100*(((double)stats_n_data_bytes_received) /
-                (stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
+        100*(((double)stats_n_data_bytes_received) /
+             (stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
 
   if (now - time_of_process_start >= 0)
     elapsed = now - time_of_process_start;
@@ -1350,7 +1351,7 @@
                  (void*)(uintptr_t)signals[i]);
       if (signal_add(&signal_events[i], NULL))
         warn(LD_BUG, "Error from libevent when adding event for signal %d",
-               signals[i]);
+             signals[i]);
     }
   } else {
     struct sigaction action;

Index: onion.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/onion.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -d -r1.190 -r1.191
--- onion.c	8 Dec 2005 17:38:32 -0000	1.190
+++ onion.c	10 Dec 2005 09:36:26 -0000	1.191
@@ -240,7 +240,7 @@
     goto err;
   } else if (len != DH_KEY_LEN) {
     warn(LD_PROTOCOL, "Unexpected onionskin length after decryption: %d",
-           len);
+         len);
     goto err;
   }
 

Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- relay.c	10 Dec 2005 08:26:54 -0000	1.91
+++ relay.c	10 Dec 2005 09:36:26 -0000	1.92
@@ -194,7 +194,8 @@
       }
       return 0;
     }
-    log_fn(LOG_PROTOCOL_WARN,LD_PROTOCOL,"Didn't recognize cell, but circ stops here! Closing circ.");
+    log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+           "Didn't recognize cell, but circ stops here! Closing circ.");
     return -1;
   }
 
@@ -241,7 +242,8 @@
       tor_assert(circ->cpath);
       thishop = circ->cpath;
       if (thishop->state != CPATH_STATE_OPEN) {
-        log_fn(LOG_PROTOCOL_WARN,LD_PROTOCOL,"Relay cell before first created cell? Closing.");
+        log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+               "Relay cell before first created cell? Closing.");
         return -1;
       }
       do { /* Remember: cpath is in forward order, that is, first hop first. */
@@ -427,7 +429,7 @@
 
   if (fromconn && fromconn->marked_for_close) {
     warn(LD_BUG,"Bug: called on conn that's already marked for close at %s:%d.",
-           fromconn->marked_for_close_file, fromconn->marked_for_close);
+         fromconn->marked_for_close_file, fromconn->marked_for_close);
     return 0;
   }
 
@@ -466,7 +468,7 @@
   }
 
   debug(LD_OR,"delivering %d cell %s.", relay_command,
-         cell_direction == CELL_DIRECTION_OUT ? "forward" : "backward");
+        cell_direction == CELL_DIRECTION_OUT ? "forward" : "backward");
 
   if (circuit_package_relay_cell(&cell, circ, cell_direction, cpath_layer) < 0) {
     warn(LD_BUG,"circuit_package_relay_cell failed. Closing.");
@@ -632,7 +634,7 @@
   if (rh->length > 0 && edge_reason_is_retriable(reason)) {
     if (conn->type != CONN_TYPE_AP) {
       warn(LD_PROTOCOL,"Got an end because of %s, but we're not an AP. Closing.",
-             connection_edge_end_reason_str(reason));
+           connection_edge_end_reason_str(reason));
       return -1;
     }
     info(LD_APP,"Address '%s' refused due to '%s'. Considering retrying.",
@@ -647,7 +649,7 @@
           int ttl;
           if (!addr) {
             info(LD_APP,"Address '%s' resolved to 0.0.0.0. Closing,",
-                   safe_str(conn->socks_request->address));
+                 safe_str(conn->socks_request->address));
             connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
             return 0;
           }
@@ -713,7 +715,7 @@
   }
 
   info(LD_APP,"Edge got end (%s) before we're connected. Marking for close.",
-         connection_edge_end_reason_str(rh->length > 0 ? reason : -1));
+       connection_edge_end_reason_str(rh->length > 0 ? reason : -1));
   if (conn->type == CONN_TYPE_AP) {
     circuit_log_path(LOG_INFO,LD_APP,circ);
     connection_mark_unattached_ap(conn, reason);
@@ -747,7 +749,7 @@
 //    log_fn(LOG_INFO,"Connected! Notifying application.");
     conn->state = AP_CONN_STATE_OPEN;
     info(LD_APP,"'connected' received after %d seconds.",
-           (int)(time(NULL) - conn->timestamp_lastread));
+         (int)(time(NULL) - conn->timestamp_lastread));
     if (rh->length >= 4) {
       uint32_t addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE));
       int ttl;
@@ -802,8 +804,8 @@
   }
 
   log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
-       "Got an unexpected relay command %d, in state %d (%s). Dropping.",
-       rh->command, conn->state, conn_state_to_string(conn->type, conn->state));
+         "Got an unexpected relay command %d, in state %d (%s). Dropping.",
+         rh->command, conn->state, conn_state_to_string(conn->type, conn->state));
   return 0; /* for forward compatibility, don't kill the circuit */
 //  connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL, conn->cpath_layer);
 //  connection_mark_for_close(conn);
@@ -876,7 +878,7 @@
         return -1;
       }
       debug(domain,"circ deliver_window now %d.", layer_hint ?
-             layer_hint->deliver_window : circ->deliver_window);
+            layer_hint->deliver_window : circ->deliver_window);
 
       circuit_consider_sending_sendme(circ, layer_hint);
 
@@ -899,15 +901,15 @@
     case RELAY_COMMAND_END:
       if (!conn) {
         info(domain,"end cell (%s) dropped, unknown stream.",
-               connection_edge_end_reason_str(rh.length > 0 ?
-                 *(char *)(cell->payload+RELAY_HEADER_SIZE) : -1));
+             connection_edge_end_reason_str(rh.length > 0 ?
+               *(char *)(cell->payload+RELAY_HEADER_SIZE) : -1));
         return 0;
       }
 /* XXX add to this log_fn the exit node's nickname? */
       info(domain,"%d: end cell (%s) for stream %d. Removing stream.",
            conn->s,
            connection_edge_end_reason_str(rh.length > 0 ?
-               *(char *)(cell->payload+RELAY_HEADER_SIZE) : -1),
+             *(char *)(cell->payload+RELAY_HEADER_SIZE) : -1),
            conn->stream_id);
       if (conn->socks_request && !conn->socks_request->has_finished)
         warn(LD_BUG,"Bug: open stream hasn't sent socks answer yet? Closing.");
@@ -986,12 +988,12 @@
         if (layer_hint) {
           layer_hint->package_window += CIRCWINDOW_INCREMENT;
           debug(LD_APP,"circ-level sendme at origin, packagewindow %d.",
-                 layer_hint->package_window);
+                layer_hint->package_window);
           circuit_resume_edge_reading(circ, layer_hint);
         } else {
           circ->package_window += CIRCWINDOW_INCREMENT;
           debug(LD_APP,"circ-level sendme at non-origin, packagewindow %d.",
-                 circ->package_window);
+                circ->package_window);
           circuit_resume_edge_reading(circ, layer_hint);
         }
         return 0;
@@ -1015,7 +1017,7 @@
         return 0;
       } else if (circ->purpose != CIRCUIT_PURPOSE_OR) {
         warn(domain, "resolve request on circ with purpose %d; dropping",
-               circ->purpose);
+             circ->purpose);
         return 0;
       }
       connection_exit_begin_resolve(cell, circ);
@@ -1070,7 +1072,7 @@
   tor_assert(!connection_speaks_cells(conn));
   if (conn->marked_for_close) {
     warn(LD_BUG,"Bug: called on conn that's already marked for close at %s:%d.",
-           conn->marked_for_close_file, conn->marked_for_close);
+         conn->marked_for_close_file, conn->marked_for_close);
     return 0;
   }
 
@@ -1110,7 +1112,7 @@
   connection_fetch_from_buf(payload, length, conn);
 
   debug(domain,"(%d) Packaging %d bytes (%d waiting).", conn->s,
-         (int)length, (int)buf_datalen(conn->inbuf));
+        (int)length, (int)buf_datalen(conn->inbuf));
 
   if (connection_edge_send_command(conn, circ, RELAY_COMMAND_DATA,
                                    payload, length, conn->cpath_layer) < 0)
@@ -1241,7 +1243,8 @@
     return 0;
   }
   /* else, layer hint is defined, use it */
-  debug(domain,"considering layer_hint->package_window %d", layer_hint->package_window);
+  debug(domain,"considering layer_hint->package_window %d",
+        layer_hint->package_window);
   if (layer_hint->package_window <= 0) {
     debug(domain,"yes, at-origin. stopped.");
     for (conn = circ->n_streams; conn; conn=conn->next_stream)

Index: rendclient.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendclient.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- rendclient.c	15 Nov 2005 03:05:21 -0000	1.98
+++ rendclient.c	10 Dec 2005 09:36:26 -0000	1.99
@@ -69,7 +69,7 @@
 
   if (rend_cache_lookup_entry(introcirc->rend_query, -1, &entry) < 1) {
     warn(LD_REND,"query '%s' didn't have valid rend desc in cache. Failing.",
-           safe_str(introcirc->rend_query));
+         safe_str(introcirc->rend_query));
     goto err;
   }
 
@@ -181,7 +181,7 @@
 
   if (circ->purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) {
     warn(LD_PROTOCOL, "Received REND_INTRODUCE_ACK on unexpected circuit %d.",
-           circ->n_circ_id);
+         circ->n_circ_id);
     circuit_mark_for_close(circ);
     return -1;
   }
@@ -221,7 +221,7 @@
       extend_info = rend_client_get_random_intro(circ->rend_query);
       if (!extend_info) {
         warn(LD_REND, "No introduction points left for %s. Closing.",
-               safe_str(circ->rend_query));
+             safe_str(circ->rend_query));
         circuit_mark_for_close(circ);
         return -1;
       }
@@ -273,7 +273,7 @@
   }
   if (r==0) {
     info(LD_REND, "Unknown service %s. Re-fetching descriptor.",
-           safe_str(query));
+         safe_str(query));
     rend_client_refetch_renddesc(query);
     return 0;
   }
@@ -308,7 +308,7 @@
 
   if (!ent->parsed->n_intro_points) {
     info(LD_REND,"No more intro points remain for %s. Re-fetching descriptor.",
-           safe_str(query));
+         safe_str(query));
     rend_client_refetch_renddesc(query);
 
     /* move all pending streams back to renddesc_wait */
@@ -453,7 +453,7 @@
 
   if (rend_cache_lookup_entry(query, -1, &entry) < 1) {
     warn(LD_REND,"Query '%s' didn't have valid rend desc in cache. Failing.",
-           safe_str(query));
+         safe_str(query));
     return NULL;
   }
 

Index: rendcommon.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendcommon.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- rendcommon.c	25 Oct 2005 18:01:01 -0000	1.60
+++ rendcommon.c	10 Dec 2005 09:36:26 -0000	1.61
@@ -189,7 +189,7 @@
   if ((size_t)(end-cp) < keylen) goto truncated;
   if ((size_t)(end-cp) > keylen) {
     warn(LD_PROTOCOL, "Signature is %d bytes too long on service descriptor.",
-           (int)((size_t)(end-cp) - keylen));
+         (int)((size_t)(end-cp) - keylen));
     goto error;
   }
   if (crypto_pk_public_checksig_digest(result->pk,
@@ -378,7 +378,7 @@
   }
   if (parsed->timestamp > now+REND_CACHE_MAX_SKEW) {
     warn(LD_REND,"Service descriptor %s is too far in the future.",
-           safe_str(query));
+         safe_str(query));
     rend_service_descriptor_free(parsed);
     return -1;
   }
@@ -408,7 +408,7 @@
   memcpy(e->desc, desc, desc_len);
 
   debug(LD_REND,"Successfully stored rend desc '%s', len %d.",
-         safe_str(query), (int)desc_len);
+        safe_str(query), (int)desc_len);
   return 1;
 }
 

Index: rendmid.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendmid.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- rendmid.c	25 Oct 2005 18:01:01 -0000	1.44
+++ rendmid.c	10 Dec 2005 09:36:26 -0000	1.45
@@ -80,7 +80,7 @@
   while ((c = circuit_get_next_by_pk_and_purpose(
                                 c,pk_digest,CIRCUIT_PURPOSE_INTRO_POINT))) {
     info(LD_REND, "Replacing old circuit %d for service %s",
-           c->p_circ_id, safe_str(serviceid));
+         c->p_circ_id, safe_str(serviceid));
     circuit_mark_for_close(c);
   }
 
@@ -122,7 +122,7 @@
 
   if (circ->purpose != CIRCUIT_PURPOSE_OR || circ->n_conn) {
     warn(LD_PROTOCOL, "Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.",
-           circ->p_circ_id);
+         circ->p_circ_id);
     goto err;
   }
 
@@ -216,7 +216,7 @@
   base16_encode(hexid,9,request,4);
 
   info(LD_REND, "Established rendezvous point on circuit %d for cookie %s",
-         circ->p_circ_id, hexid);
+       circ->p_circ_id, hexid);
 
   return 0;
  err:
@@ -238,7 +238,7 @@
 
   if (request_len>=4) {
     info(LD_REND, "Got request for rendezvous from circuit %d to cookie %s.",
-           circ->p_circ_id, hexid);
+         circ->p_circ_id, hexid);
   }
 
   if (circ->purpose != CIRCUIT_PURPOSE_OR || circ->n_conn) {

Index: rendservice.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendservice.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- rendservice.c	25 Nov 2005 08:08:56 -0000	1.148
+++ rendservice.c	10 Dec 2005 09:36:26 -0000	1.149
@@ -131,7 +131,7 @@
       addr.s_addr = htonl(p->real_addr);
       tor_inet_ntoa(&addr, addrbuf, sizeof(addrbuf));
       debug(LD_REND,"Service maps port %d to %s:%d",
-             p->virtual_port, addrbuf, p->real_port);
+            p->virtual_port, addrbuf, p->real_port);
     }
   }
 }
@@ -295,7 +295,7 @@
     router = router_get_by_nickname(smartlist_get(service->intro_nodes, i),1);
     if (!router) {
       info(LD_REND,"Router '%s' not found. Skipping.",
-             (char*)smartlist_get(service->intro_nodes, i));
+           (char*)smartlist_get(service->intro_nodes, i));
       continue;
     }
     circ = find_intro_circuit(router, service->pk_digest);
@@ -416,11 +416,11 @@
   base32_encode(serviceid, REND_SERVICE_ID_LEN+1,
                 circuit->rend_pk_digest,10);
   info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %d.",
-         serviceid, circuit->n_circ_id);
+       serviceid, circuit->n_circ_id);
 
   if (circuit->purpose != CIRCUIT_PURPOSE_S_INTRO) {
     warn(LD_PROTOCOL, "Got an INTRODUCE2 over a non-introduction circuit %d.",
-           circuit->n_circ_id);
+         circuit->n_circ_id);
     return -1;
   }
 
@@ -428,7 +428,7 @@
   if (request_len < DIGEST_LEN+REND_COOKIE_LEN+(MAX_NICKNAME_LEN+1)+
       DH_KEY_LEN+42) {
     warn(LD_PROTOCOL, "Got a truncated INTRODUCE2 cell on circ %d.",
-           circuit->n_circ_id);
+         circuit->n_circ_id);
     return -1;
   }
 
@@ -436,13 +436,13 @@
   service = rend_service_get_by_pk_digest(request);
   if (!service) {
     warn(LD_REND, "Got an INTRODUCE2 cell for an unrecognized service %s.",
-           serviceid);
+         serviceid);
     return -1;
   }
   if (memcmp(circuit->rend_pk_digest, request, DIGEST_LEN)) {
     base32_encode(serviceid, REND_SERVICE_ID_LEN+1, request, 10);
     warn(LD_REND, "Got an INTRODUCE2 cell for the wrong service (%s).",
-           serviceid);
+         serviceid);
     return -1;
   }
 
@@ -515,7 +515,7 @@
     router = router_get_by_nickname(rp_nickname, 0);
     if (!router) {
       info(LD_REND, "Couldn't find router '%s' named in rendezvous cell.",
-             rp_nickname);
+           rp_nickname);
       goto err;
     }
 
@@ -558,7 +558,7 @@
   }
   if (!launched) { /* give up */
     warn(LD_REND,"Giving up launching first hop of circuit to rendezvous point '%s' for service %s.",
-           extend_info->nickname, serviceid);
+         extend_info->nickname, serviceid);
     goto err;
   }
   info(LD_REND,
@@ -606,8 +606,8 @@
       oldcirc->build_state->failure_count > MAX_REND_FAILURES ||
       oldcirc->build_state->expiry_time < time(NULL)) {
     info(LD_REND,"Attempt to build circuit to %s for rendezvous has failed too many times or expired; giving up.",
-           oldcirc->build_state ? oldcirc->build_state->chosen_exit->nickname :
-           "*unknown*");
+         oldcirc->build_state ? oldcirc->build_state->chosen_exit->nickname :
+         "*unknown*");
     return;
   }
 
@@ -620,13 +620,13 @@
   }
 
   info(LD_REND,"Reattempting rendezvous circuit to %s",
-         oldstate->chosen_exit->nickname);
+       oldstate->chosen_exit->nickname);
 
   newcirc = circuit_launch_by_extend_info(CIRCUIT_PURPOSE_S_CONNECT_REND,
                                oldstate->chosen_exit, 0, 1, 1);
   if (!newcirc) {
     warn(LD_REND,"Couldn't relaunch rendezvous circuit to %s.",
-           oldstate->chosen_exit->nickname);
+         oldstate->chosen_exit->nickname);
     return;
   }
   newstate = newcirc->build_state;
@@ -650,7 +650,7 @@
   circuit_t *launched;
 
   info(LD_REND, "Launching circuit to introduction point %s for service %s",
-         nickname, service->service_id);
+       nickname, service->service_id);
 
   rep_hist_note_used_internal(time(NULL), 1, 0);
 
@@ -658,7 +658,7 @@
   launched = circuit_launch_by_nickname(CIRCUIT_PURPOSE_S_ESTABLISH_INTRO, nickname, 1, 0, 1);
   if (!launched) {
     info(LD_REND, "Can't launch circuit to establish introduction at '%s'.",
-           nickname);
+         nickname);
     return -1;
   }
   strlcpy(launched->rend_query, service->service_id,
@@ -693,7 +693,7 @@
   service = rend_service_get_by_pk_digest(circuit->rend_pk_digest);
   if (!service) {
     warn(LD_REND, "Unrecognized service ID %s on introduction circuit %d.",
-           serviceid, circuit->n_circ_id);
+         serviceid, circuit->n_circ_id);
     goto err;
   }
 
@@ -746,7 +746,7 @@
   service = rend_service_get_by_pk_digest(circuit->rend_pk_digest);
   if (!service) {
     warn(LD_REND, "Unknown service on introduction circuit %d.",
-           circuit->n_circ_id);
+         circuit->n_circ_id);
     goto err;
   }
   service->desc_is_dirty = time(NULL);
@@ -782,7 +782,7 @@
 
   info(LD_REND,
        "Done building circuit %d to rendezvous with cookie %s for service %s",
-         circuit->n_circ_id, hexcookie, serviceid);
+       circuit->n_circ_id, hexcookie, serviceid);
 
   service = rend_service_get_by_pk_digest(circuit->rend_pk_digest);
   if (!service) {
@@ -937,7 +937,7 @@
       router = router_get_by_nickname(intro, 0);
       if (!router || !find_intro_circuit(router,service->pk_digest)) {
         info(LD_REND,"Giving up on %s as intro point for %s.",
-                intro, service->service_id);
+             intro, service->service_id);
         tor_free(intro);
         smartlist_del(service->intro_nodes,j--);
         changed = 1;
@@ -969,7 +969,7 @@
                get_options()->_AllowUnverified & ALLOW_UNVERIFIED_INTRODUCTION, 0);
       if (!router) {
         warn(LD_REND, "Could only establish %d introduction points for %s.",
-               smartlist_len(service->intro_nodes), service->service_id);
+             smartlist_len(service->intro_nodes), service->service_id);
         break;
       }
       changed = 1;
@@ -998,7 +998,7 @@
       r = rend_service_launch_establish_intro(service, intro);
       if (r<0) {
         warn(LD_REND, "Error launching circuit to node %s for service %s.",
-               intro, service->service_id);
+             intro, service->service_id);
       }
     }
   }
@@ -1093,7 +1093,7 @@
   service = rend_service_get_by_pk_digest(circ->rend_pk_digest);
   if (!service) {
     warn(LD_REND, "Couldn't find any service associated with pk %s on rendezvous circuit %d; closing.",
-           serviceid, circ->n_circ_id);
+         serviceid, circ->n_circ_id);
     return -1;
   }
   for (i = 0; i < smartlist_len(service->ports); ++i) {
@@ -1105,7 +1105,7 @@
     }
   }
   info(LD_REND, "No virtual port mapping exists for port %d on service %s",
-         conn->port,serviceid);
+       conn->port,serviceid);
   return -1;
 }
 

Index: router.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -d -r1.233 -r1.234
--- router.c	30 Nov 2005 06:27:59 -0000	1.233
+++ router.c	10 Dec 2005 09:36:26 -0000	1.234
@@ -168,7 +168,7 @@
   /* The old filename exists, and the new one doesn't.  Rename and load. */
   if (rename(fname_old, fname_new) < 0) {
     log_fn(LOG_ERR, LD_FS, "Couldn't rename \"%s\" to \"%s\": %s",
-        fname_old, fname_new, strerror(errno));
+           fname_old, fname_new, strerror(errno));
     return NULL;
   }
   return init_key_from_file(fname_new);
@@ -466,7 +466,7 @@
   if (!can_reach_or_port) {
     if (!clique_mode(get_options()))
       notice(LD_OR,"Self-testing indicates your ORPort is reachable from the outside. Excellent.%s",
-          get_options()->NoPublish ? "" : " Publishing server descriptor.");
+            get_options()->NoPublish ? "" : " Publishing server descriptor.");
     can_reach_or_port = 1;
     mark_my_descriptor_dirty();
     consider_publishable_server(time(NULL), 1);
@@ -615,8 +615,8 @@
     if (force ||
       !connection_or_get_by_identity_digest(router->cache_info.identity_digest)) {
       debug(LD_OR,"%sconnecting to %s at %s:%u.",
-             clique_mode(options) ? "(forced) " : "",
-             router->nickname, router->address, router->or_port);
+            clique_mode(options) ? "(forced) " : "",
+            router->nickname, router->address, router->or_port);
       /* Remember when we started trying to determine reachability */
       if (!router->testing_since)
         router->testing_since = now;
@@ -820,8 +820,8 @@
        if (!member) {
          if (!smartlist_string_isin(warned_nonexistent_family, name)) {
            warn(LD_CONFIG, "I have no descriptor for the router named \"%s\" "
-                  "in my declared family; I'll use the nickname as is, but "
-                  "this may confuse clients.", name);
+                "in my declared family; I'll use the nickname as is, but "
+                "this may confuse clients.", name);
            smartlist_add(warned_nonexistent_family, tor_strdup(name));
          }
          smartlist_add(ri->declared_family, name);

Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.387
retrieving revision 1.388
diff -u -d -r1.387 -r1.388
--- routerlist.c	10 Dec 2005 08:26:54 -0000	1.387
+++ routerlist.c	10 Dec 2005 09:36:26 -0000	1.388
@@ -106,7 +106,7 @@
       if (strlen(fn) != HEX_DIGEST_LEN ||
           base16_decode(buf, sizeof(buf), fn, strlen(fn))) {
         info(LD_DIR,
-               "Skipping cached-status file with unexpected name \"%s\"",fn);
+             "Skipping cached-status file with unexpected name \"%s\"",fn);
         continue;
       }
       tor_snprintf(filename,sizeof(filename),"%s/cached-status/%s",
@@ -345,7 +345,7 @@
     return choice;
 
   info(LD_DIR,"Still no %s router entries. Reloading and trying again.",
-         fascistfirewall ? "reachable" : "known");
+       fascistfirewall ? "reachable" : "known");
   if (router_reload_router_list()) {
     return NULL;
   }
@@ -934,9 +934,9 @@
       if (any_unwarned) {
         char *alternatives = smartlist_join_strings(fps, "; ",0,NULL);
         warn(LD_CONFIG, "There are multiple matches for the nickname \"%s\","
-               " but none is listed as named by the directory authories. "
-               "Choosing one arbitrarily.  If you meant one in particular, "
-               "you should say %s.", nickname, alternatives);
+             " but none is listed as named by the directory authories. "
+             "Choosing one arbitrarily.  If you meant one in particular, "
+             "you should say %s.", nickname, alternatives);
         tor_free(alternatives);
       }
       SMARTLIST_FOREACH(fps, char *, cp, tor_free(cp));
@@ -948,9 +948,9 @@
         char fp[HEX_DIGEST_LEN+1];
         base16_encode(fp, sizeof(fp), best_match->cache_info.identity_digest, DIGEST_LEN);
         warn(LD_CONFIG, "You specified a server \"%s\" by name, but the "
-               "directory authorities do not have a listing for this name. "
-               "To make sure you get the same server in the future, refer to "
-               "it by key, as \"$%s\".", nickname, fp);
+             "directory authorities do not have a listing for this name. "
+             "To make sure you get the same server in the future, refer to "
+             "it by key, as \"$%s\".", nickname, fp);
         rs->name_lookup_warned = 1;
       }
     }
@@ -1493,7 +1493,7 @@
           old_router->cache_info.published_on) {
         /* Same key, but old */
         debug(LD_DIR, "Skipping not-new descriptor for router '%s'",
-               router->nickname);
+              router->nickname);
         routerlist_insert_old(routerlist, router);
         *msg = "Router descriptor was not new.";
         return -1;
@@ -1501,8 +1501,8 @@
         /* Same key, new. */
         int unreachable = 0;
         debug(LD_DIR, "Replacing entry for router '%s/%s' [%s]",
-               router->nickname, old_router->nickname,
-               hex_str(id_digest,DIGEST_LEN));
+              router->nickname, old_router->nickname,
+              hex_str(id_digest,DIGEST_LEN));
         if (router->addr == old_router->addr &&
             router->or_port == old_router->or_port) {
           /* these carry over when the address and orport are unchanged.*/
@@ -1516,8 +1516,8 @@
           if (router->num_unreachable_notifications >= 3) {
             unreachable = 1;
             notice(LD_DIR, "Notifying server '%s' that it's unreachable. (ContactInfo '%s', platform '%s').",
-              router->nickname, router->contact_info ? router->contact_info : "",
-              router->platform ? router->platform : "");
+                   router->nickname, router->contact_info ? router->contact_info : "",
+                   router->platform ? router->platform : "");
           } else {
             info(LD_DIR,"'%s' may be unreachable -- the %d previous "
                  "descriptors were thought to be unreachable.",
@@ -1550,14 +1550,14 @@
                       old_router->cache_info.identity_digest))) {
           // And LD_OR? XXXXNM
           info(LD_DIR,"Closing conn to router '%s'; there is now a named router with that name.",
-                 old_router->nickname);
+               old_router->nickname);
           connection_mark_for_close(conn);
         }
         routerlist_remove(routerlist, old_router, i--, 0);
       } else if (old_router->is_named) {
         /* Can't replace a verified router with an unverified one. */
         debug(LD_DIR, "Skipping unverified entry for verified router '%s'",
-               router->nickname);
+              router->nickname);
         routerinfo_free(router);
         *msg = "Already have named router with same nickname and different key.";
         return -2;
@@ -1770,7 +1770,7 @@
 
   if (router_add_to_routerlist(ri, msg, 0)<0) {
     warn(LD_DIR, "Couldn't add router to list: %s Dropping.",
-           *msg?*msg:"(No message).");
+         *msg?*msg:"(No message).");
     /* we've already assigned to *msg now, and ri is already freed */
     smartlist_free(lst);
     return 0;
@@ -1940,7 +1940,9 @@
       smartlist_string_remove(requested_fingerprints, fp);
     } else {
       char *requested = smartlist_join_strings(requested_fingerprints," ",0,NULL);
-      warn(LD_DIR, "We received a network status with a fingerprint (%s) that we never requested. (We asked for: %s.) Dropping.", fp, requested);
+      warn(LD_DIR,
+           "We received a network status with a fingerprint (%s) that we "
+           "never requested. (We asked for: %s.) Dropping.", fp, requested);
       tor_free(requested);
       return 0;
     }
@@ -1959,9 +1961,9 @@
         /* Same one we had before. */
         networkstatus_free(ns);
         info(LD_DIR,
-               "Not replacing network-status from %s (published %s); "
-               "we already have it.",
-               trusted_dir->description, published);
+             "Not replacing network-status from %s (published %s); "
+             "we already have it.",
+             trusted_dir->description, published);
         if (old_ns->received_on < arrived_at) {
           if (source != NS_FROM_CACHE) {
             char *fn = networkstatus_get_cache_filename(old_ns);
@@ -1976,10 +1978,10 @@
         char old_published[ISO_TIME_LEN+1];
         format_iso_time(old_published, old_ns->published_on);
         info(LD_DIR,
-               "Not replacing network-status from %s (published %s);"
-               " we have a newer one (published %s) for this authority.",
-               trusted_dir->description, published,
-               old_published);
+             "Not replacing network-status from %s (published %s);"
+             " we have a newer one (published %s) for this authority.",
+             trusted_dir->description, published,
+             old_published);
         networkstatus_free(ns);
         return 0;
       } else {
@@ -1995,9 +1997,9 @@
     smartlist_add(networkstatus_list, ns);
 
   info(LD_DIR, "Setting networkstatus %s %s (published %s)",
-         source == NS_FROM_CACHE?"cached from":
-         (source==NS_FROM_DIR?"downloaded from":"generated for"),
-         trusted_dir->description, published);
+       source == NS_FROM_CACHE?"cached from":
+       (source==NS_FROM_DIR?"downloaded from":"generated for"),
+       trusted_dir->description, published);
   networkstatus_list_has_changed = 1;
 
   smartlist_sort(networkstatus_list, _compare_networkstatus_published_on);
@@ -2212,16 +2214,16 @@
 
   if (needed)
     info(LD_DIR, "For %d/%d running directory servers, we have %d live"
-           " network-status documents. Downloading %d.",
-           n_running_dirservers, n_dirservers, n_live, needed);
+         " network-status documents. Downloading %d.",
+         n_running_dirservers, n_dirservers, n_live, needed);
 
   /* Also, download at least 1 every NETWORKSTATUS_CLIENT_DL_INTERVAL. */
   if (n_running_dirservers &&
       most_recent_received < now-NETWORKSTATUS_CLIENT_DL_INTERVAL && needed < 1) {
     info(LD_DIR, "Our most recent network-status document (from %s) "
-           "is %d seconds old; downloading another.",
-           most_recent?most_recent->description:"nobody",
-           (int)(now-most_recent_received));
+         "is %d seconds old; downloading another.",
+         most_recent?most_recent->description:"nobody",
+         (int)(now-most_recent_received));
     needed = 1;
   }
 
@@ -2439,8 +2441,8 @@
               policy, private_networks[i].addr, private_networks[i].mask, &p)) {
       if (should_warn)
         warn(LD_CONFIG, "Exit policy %s implicitly accepts %s",
-               p?p->string:"(default)",
-               private_networks[i].network);
+             p?p->string:"(default)",
+             private_networks[i].network);
       r = 1;
     }
   }
@@ -2586,11 +2588,11 @@
        * have tried all of them? -RD */
       if (n_valid <= n_recent/2)  {
         warn(LD_GENERAL, "%d/%d recent directory servers list us as invalid. Please consider sending your identity fingerprint to the tor-ops.",
-               n_recent-n_valid, n_recent);
+             n_recent-n_valid, n_recent);
         have_warned_about_unverified_status = 1;
       } else if (!n_named) { // (n_named <= n_recent/2) {
         warn(LD_GENERAL, "0/%d recent directory servers recognize this server. Please consider sending your identity fingerprint to the tor-ops.",
-               n_recent);
+             n_recent);
         have_warned_about_unverified_status = 1;
       }
     }
@@ -2635,7 +2637,7 @@
       }
     } else {
       info(LD_GENERAL, "%d/%d recent directories think my version is ok.",
-             n_recommended, n_recent);
+           n_recommended, n_recent);
     }
   }
 
@@ -2676,8 +2678,8 @@
       if (!ns->is_recent) {
         format_iso_time(published, ns->published_on);
         info(LD_DIR,
-               "Networkstatus from %s (published %s) is now \"recent\"",
-               src, published);
+             "Networkstatus from %s (published %s) is now \"recent\"",
+             src, published);
         changed = 1;
       }
       ns->is_recent = 1;
@@ -2686,8 +2688,8 @@
       if (ns->is_recent) {
         format_iso_time(published, ns->published_on);
         info(LD_DIR,
-               "Networkstatus from %s (published %s) is no longer \"recent\"",
-               src, published);
+             "Networkstatus from %s (published %s) is no longer \"recent\"",
+             src, published);
         changed = 1;
         ns->is_recent = 0;
       }
@@ -2848,7 +2850,7 @@
           base16_encode(hd, HEX_DIGEST_LEN+1, rs->identity_digest, DIGEST_LEN);
           if (! smartlist_string_isin(warned_conflicts, hd)) {
             warn(LD_DIR, "Naming authorities disagree about nicknames for $%s (\"%s\" vs \"%s\")",
-                   hd, the_name, rs->nickname);
+                 hd, the_name, rs->nickname);
             smartlist_add(warned_conflicts, tor_strdup(hd));
           }
           the_name = "**mismatch**";
@@ -2868,11 +2870,11 @@
     }
     smartlist_add(result, rs_out);
     debug(LD_DIR, "Router '%s' is listed by %d/%d directories, "
-           "named by %d/%d, validated by %d/%d, and %d/%d recent directories "
-           "think it's running.",
-           rs_out->status.nickname,
-           n_listing, n_statuses, n_named, n_naming, n_valid, n_statuses,
-           n_running, n_recent);
+          "named by %d/%d, validated by %d/%d, and %d/%d recent directories "
+          "think it's running.",
+          rs_out->status.nickname,
+          n_listing, n_statuses, n_named, n_naming, n_valid, n_statuses,
+          n_running, n_recent);
     rs_out->status.is_named  = 0;
     if (the_name && strcmp(the_name, "**mismatch**") && n_named > 0) {
       const char *d = strmap_get_lc(name_map, the_name);
@@ -3090,17 +3092,17 @@
 
 #if 0
   info(LD_DIR, "%d router descriptors are downloadable; "
-         "%d are up to date; %d are in progress; "
-         "%d are not ready to retry; "
-         "%d are not published recently enough to be worthwhile; "
-         "%d are running pre-0.1.1.6 Tors and aren't stale enough to replace. "
-         "%d have unrecognized descriptor hashes; %d are newer than the dirs "
-         "have told us about; %d are both unrecognized and newer than any "
-         "publication date in the networkstatus; %d are both "
-         "unrecognized and running a pre-0.1.1.6 version.",
-         n_downloadable, n_uptodate, n_in_progress, n_not_ready,
-         n_obsolete, n_skip_old, xx_n_unrecognized, xx_n_extra_new, xx_n_both,
-         xx_n_unrec_old);
+       "%d are up to date; %d are in progress; "
+       "%d are not ready to retry; "
+       "%d are not published recently enough to be worthwhile; "
+       "%d are running pre-0.1.1.6 Tors and aren't stale enough to replace. "
+       "%d have unrecognized descriptor hashes; %d are newer than the dirs "
+       "have told us about; %d are both unrecognized and newer than any "
+       "publication date in the networkstatus; %d are both "
+       "unrecognized and running a pre-0.1.1.6 version.",
+       n_downloadable, n_uptodate, n_in_progress, n_not_ready,
+       n_obsolete, n_skip_old, xx_n_unrecognized, xx_n_extra_new, xx_n_both,
+       xx_n_unrec_old);
 #endif
 
   if (!n_downloadable)
@@ -3153,7 +3155,7 @@
   n_downloadable = smartlist_len(downloadable);
   if (n_downloadable >= MAX_DL_TO_DELAY) {
     debug(LD_DIR,
-           "There are enough downloadable routerdescs to launch requests.");
+          "There are enough downloadable routerdescs to launch requests.");
     should_delay = 0;
   } else if (n_downloadable == 0) {
 //    debug(LD_DIR, "No routerdescs need to be downloaded.");
@@ -3170,7 +3172,7 @@
 //      debug(LD_DIR, "There are not many downloadable routerdescs; waiting till we have some more.");
     } else
       info(LD_DIR, "There are not many downloadable routerdescs, but we've been waiting long enough (%d seconds). Downloading.",
-             (int)(now-last_routerdesc_download_attempted));
+           (int)(now-last_routerdesc_download_attempted));
   }
 
   if (! should_delay) {
@@ -3186,9 +3188,9 @@
         n_per_request = MIN_DL_PER_REQUEST;
     }
     info(LD_DIR, "Launching %d request%s for %d router%s, %d at a time",
-           (n_downloadable+n_per_request-1)/n_per_request,
-           n_downloadable>n_per_request?"s":"",
-           n_downloadable, n_downloadable>1?"s":"", n_per_request);
+         (n_downloadable+n_per_request-1)/n_per_request,
+         n_downloadable>n_per_request?"s":"",
+         n_downloadable, n_downloadable>1?"s":"", n_per_request);
     for (i=0; i < n_downloadable; i += n_per_request) {
       char *cp = resource;
       memcpy(resource, "fp/", 3);

Index: routerparse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- routerparse.c	30 Nov 2005 06:27:59 -0000	1.161
+++ routerparse.c	10 Dec 2005 09:36:26 -0000	1.162
@@ -271,7 +271,7 @@
   vl = versionlist;
 
   debug(LD_CONFIG,"Checking whether version '%s' is in '%s'",
-         myversion, versionlist);
+        myversion, versionlist);
 
   if (tor_version_parse(myversion, &mine)) {
     err(LD_BUG,"I couldn't parse my own version (%s)", myversion);
@@ -467,7 +467,7 @@
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
     warn(LD_DIR, "Unrecognized keyword '%s'; can't parse running-routers",
-           tok->args[0]);
+         tok->args[0]);
     goto err;
   }
   tok = smartlist_get(tokens,0);
@@ -731,8 +731,10 @@
     goto err;
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
-    warn(LD_DIR, "Unrecognized critical keyword '%s'; skipping descriptor. (It may be from another version of Tor.)",
-           tok->args[0]);
+    warn(LD_DIR,
+         "Unrecognized critical keyword '%s'; skipping descriptor. "
+         "(It may be from another version of Tor.)",
+         tok->args[0]);
     goto err;
   }
 
@@ -830,7 +832,7 @@
   }
   if (crypto_pk_keysize(tok->key) != PK_BYTES) {
     warn(LD_DIR, "Wrong size on onion key: %d bits!",
-           (int)crypto_pk_keysize(tok->key)*8);
+         (int)crypto_pk_keysize(tok->key)*8);
     goto err;
   }
   router->onion_pkey = tok->key;
@@ -994,7 +996,7 @@
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
     warn(LD_DIR, "Unrecognized keyword \"%s\" in router status; skipping.",
-           tok->args[0]);
+         tok->args[0]);
     goto err;
   }
   if (!(tok = find_first_by_keyword(tokens, K_R))) {
@@ -1003,13 +1005,13 @@
   }
   if (tok->n_args < 8) {
     warn(LD_DIR,
-           "Too few arguments to 'r' keywork in router status; skipping.");
+         "Too few arguments to 'r' keywork in router status; skipping.");
   }
   rs = tor_malloc_zero(sizeof(routerstatus_t));
 
   if (!is_legal_nickname(tok->args[0])) {
     warn(LD_DIR,
-           "Invalid nickname '%s' in router status; skipping.", tok->args[0]);
+         "Invalid nickname '%s' in router status; skipping.", tok->args[0]);
     goto err;
   }
   strlcpy(rs->nickname, tok->args[0], sizeof(rs->nickname));
@@ -1108,7 +1110,7 @@
   }
   if ((tok = find_first_by_keyword(tokens, _UNRECOGNIZED))) {
     warn(LD_DIR, "Unrecognized keyword '%s'; can't parse network-status",
-           tok->args[0]);
+         tok->args[0]);
     goto err;
   }
   ns = tor_malloc_zero(sizeof(networkstatus_t));
@@ -1686,7 +1688,7 @@
   }
   if (start != s && *(start-1) != '\n') {
     warn(LD_DIR, "first occurrence of \"%s\" is not at the start of a line",
-           start_str);
+         start_str);
     return -1;
   }
   end = strstr(start+strlen(start_str), end_str);



More information about the tor-commits mailing list