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

[or-cvs] r8622: minor cleanups (in tor/trunk: . doc src/common src/or)



Author: arma
Date: 2006-10-06 20:50:39 -0400 (Fri, 06 Oct 2006)
New Revision: 8622

Modified:
   tor/trunk/ChangeLog
   tor/trunk/doc/tor-spec.txt
   tor/trunk/src/common/container.c
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/control.c
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/router.c
   tor/trunk/src/or/routerlist.c
Log:
minor cleanups


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/ChangeLog	2006-10-07 00:50:39 UTC (rev 8622)
@@ -65,9 +65,9 @@
       a hostname; any router can call itself Unnamed; directory
       authorities will never allocate Unnamed to any particular router;
       clients won't believe that any router is the canonical Unnamed.
-    - Only include function names in log messages for debugging messages;
-      in other cases, the content of the message should be clear on its
-      own, and including the function name only seems to confuse users.
+    - Only include function names in log messages for info/debug messages.
+      For notice/warn/err, the content of the message should be clear on
+      its own, and printing the function name only seems to confuse users.
     - Avoid some false positives during reachability testing: don't try
       to test via a server that's on the same /24 as us.
     - New controller event to alert the controller when our server
@@ -176,7 +176,7 @@
     - Be clearer that the *ListenAddress directives can be repeated
       multiple times.
 
-    (stopped at r8519)
+    (stopped at r8536)
     - Build correctly for use on OS X platforms with case-sensitive
       filesystems.
 

Modified: tor/trunk/doc/tor-spec.txt
===================================================================
--- tor/trunk/doc/tor-spec.txt	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/doc/tor-spec.txt	2006-10-07 00:50:39 UTC (rev 8622)
@@ -727,7 +727,7 @@
    with a REASON_NOTDIRECTORY RELAY_END cell.
 
    [RELAY_BEGIN_DIR was not supported before Tor 0.1.2.2-alpha; clients
-   SHOULD NOT send it to routers running earlier version of Tor.]
+   SHOULD NOT send it to routers running earlier versions of Tor.]
 
 6.3. Closing streams
 

Modified: tor/trunk/src/common/container.c
===================================================================
--- tor/trunk/src/common/container.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/common/container.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -542,7 +542,7 @@
 }
 
 /** Insert <b>item</b> into the heap stored in <b>sl</b>, where order
- * is determined by <b>compare</b> */
+ * is determined by <b>compare</b>. */
 void
 smartlist_pqueue_add(smartlist_t *sl,
                      int (*compare)(const void *a, const void *b),
@@ -636,7 +636,7 @@
   return !strcmp(a->key, b->key);
 }
 
-/** Helper: return a hash value for a strmap_entry_t */
+/** Helper: return a hash value for a strmap_entry_t. */
 static INLINE unsigned int
 strmap_entry_hash(strmap_entry_t *a)
 {
@@ -650,7 +650,7 @@
   return !memcmp(a->key, b->key, DIGEST_LEN);
 }
 
-/** Helper: return a hash value for a digest_map_t */
+/** Helper: return a hash value for a digest_map_t. */
 static INLINE unsigned int
 digestmap_entry_hash(digestmap_entry_t *a)
 {
@@ -1051,7 +1051,7 @@
   return HT_EMPTY(&map->head);
 }
 
-/** Return the number of items in <b>map</b> */
+/** Return the number of items in <b>map</b>. */
 int
 strmap_size(strmap_t *map)
 {

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/circuitbuild.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -1816,7 +1816,7 @@
   return changed;
 }
 
-/** Return true iff enought time has passed since we last tried connect to the
+/** Return true iff enough time has passed since we last tried connect to the
  * unreachable guard <b>e</b> that we're willing to try again. */
 static int
 entry_is_time_to_retry(entry_guard_t *e, time_t now)
@@ -1896,7 +1896,7 @@
 }
 
 /** Dump a description of our list of entry guards to the log at level
- * <b>severity</b> */
+ * <b>severity</b>. */
 static void
 log_entry_guards(int severity)
 {

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/connection_edge.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -2144,7 +2144,7 @@
  * bridge connection with a socketpair, create a new directory conn, and join
  * them together.  Return 0 on success (or if there was an error we could send
  * back an end cell for).  Return -1 if the circuit needs to be torn down.
- * Either connects exit_conn, or frees it, or marks it as appropriate.
+ * Either connects exit_conn, or frees it, or marks it, as appropriate.
  */
 static int
 connection_exit_connect_dir(edge_connection_t *exit_conn)
@@ -2187,7 +2187,6 @@
   if (connection_add(TO_CONN(exit_conn))<0) {
     connection_edge_end(exit_conn, END_STREAM_REASON_RESOURCELIMIT,
                         exit_conn->cpath_layer);
-    /* XXXX Have I got the free/mark distinction right? -NM */
     connection_free(TO_CONN(exit_conn));
     connection_free(TO_CONN(dir_conn));
     return 0;

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/control.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -66,23 +66,23 @@
  * because it use used both as a list of v0 event types, and as indices
  * into the bitfield to determine which controllers want which events.
  */
-#define _EVENT_MIN            0x0001
-#define EVENT_CIRCUIT_STATUS  0x0001
-#define EVENT_STREAM_STATUS   0x0002
-#define EVENT_OR_CONN_STATUS  0x0003
-#define EVENT_BANDWIDTH_USED  0x0004
-#define EVENT_LOG_OBSOLETE    0x0005
-#define EVENT_NEW_DESC        0x0006
-#define EVENT_DEBUG_MSG       0x0007
-#define EVENT_INFO_MSG        0x0008
-#define EVENT_NOTICE_MSG      0x0009
-#define EVENT_WARN_MSG        0x000A
-#define EVENT_ERR_MSG         0x000B
-#define LAST_V0_EVENT         0x000B
-#define EVENT_ADDRMAP         0x000C
+#define _EVENT_MIN             0x0001
+#define EVENT_CIRCUIT_STATUS   0x0001
+#define EVENT_STREAM_STATUS    0x0002
+#define EVENT_OR_CONN_STATUS   0x0003
+#define EVENT_BANDWIDTH_USED   0x0004
+#define EVENT_LOG_OBSOLETE     0x0005
+#define EVENT_NEW_DESC         0x0006
+#define EVENT_DEBUG_MSG        0x0007
+#define EVENT_INFO_MSG         0x0008
+#define EVENT_NOTICE_MSG       0x0009
+#define EVENT_WARN_MSG         0x000A
+#define EVENT_ERR_MSG          0x000B
+#define LAST_V0_EVENT          0x000B
+#define EVENT_ADDRMAP          0x000C
 #define EVENT_AUTHDIR_NEWDESCS 0x000D
-#define EVENT_DESCCHANGED     0x000E
-#define _EVENT_MAX            0x000E
+#define EVENT_DESCCHANGED      0x000E
+#define _EVENT_MAX             0x000E
 
 /** Array mapping from message type codes to human-readable message
  * type names. Used for compatibility with version 0 of the control

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/directory.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -129,6 +129,8 @@
   int directconn = !purpose_is_private(purpose);
   authority_type_t type;
 
+  /* FFFF we could break this switch into its own function, and call
+   * it elsewhere in directory.c. -RD */
   switch (purpose) {
     case DIR_PURPOSE_FETCH_NETWORKSTATUS:
     case DIR_PURPOSE_FETCH_SERVERDESC:
@@ -182,7 +184,7 @@
   if (!directconn) {
     /* Never use fascistfirewall; we're going via Tor. */
     if (purpose == DIR_PURPOSE_FETCH_RENDDESC) {
-      /* only ask authdirservers, any of them will do */
+      /* only ask hidserv authorities, any of them will do */
       rs = router_pick_trusteddirserver(HIDSERV_AUTHORITY, 0, 0,
                                         retry_if_no_servers);
     } else {
@@ -191,7 +193,7 @@
                                         retry_if_no_servers);
       /* If we have any hope of building an indirect conn, we know some router
        * descriptors.  If (rs==NULL), we can't build circuits anyway, so
-       * there's no point in falling back to the authorities in this case.  */
+       * there's no point in falling back to the authorities in this case. */
     }
   }
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/or.h	2006-10-07 00:50:39 UTC (rev 8622)
@@ -2535,7 +2535,7 @@
   /** True iff this server is an authority for the newer ("v2") directory
    * protocol. */
   unsigned int is_v2_authority:1;
-  /** True iff this server is an authority for hidden services */
+  /** True iff this server is an authority for hidden services. */
   unsigned int is_hidserv_authority:1;
 
   int n_networkstatus_failures; /**< How many times have we asked for this

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/router.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -361,10 +361,10 @@
   crypto_pk_get_digest(get_identity_key(), digest);
   if (!router_digest_is_trusted_dir(digest)) {
     add_trusted_dir_server(options->Nickname, NULL,
-                          (uint16_t)options->DirPort, digest,
-                          options->V1AuthoritativeDir, /* v1 authority */
-                          1, /* v2 authority */
-                          options->HSAuthoritativeDir /* hidserv authority */);
+                           (uint16_t)options->DirPort, digest,
+                           options->V1AuthoritativeDir, /* v1 authority */
+                           1, /* v2 authority */
+                           options->HSAuthoritativeDir /*hidserv authority*/);
   }
   return 0; /* success */
 }

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2006-10-06 23:41:53 UTC (rev 8621)
+++ tor/trunk/src/or/routerlist.c	2006-10-07 00:50:39 UTC (rev 8622)
@@ -2294,8 +2294,8 @@
   }
   base16_encode(fp, HEX_DIGEST_LEN+1, ns->identity_digest, DIGEST_LEN);
   if (!(trusted_dir =
-        router_get_trusteddirserver_by_digest(ns->identity_digest))
-      || !trusted_dir->is_v2_authority) {
+        router_get_trusteddirserver_by_digest(ns->identity_digest)) ||
+      !trusted_dir->is_v2_authority) {
     log_info(LD_DIR, "Network status was signed, but not by an authoritative "
              "directory we recognize.");
     if (!get_options()->DirPort) {