[or-cvs] [tor/master 6/9] trivial cleanups

arma at torproject.org arma at torproject.org
Fri Jan 15 22:35:03 UTC 2010


Author: Roger Dingledine <arma at torproject.org>
Date: Tue, 12 Jan 2010 14:05:12 -0500
Subject: trivial cleanups
Commit: 50e8210943db2cab3a04e23731969b07c366935c

---
 src/or/directory.c |   25 +++++++++++++------------
 src/or/dirserv.c   |    7 +++----
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index e5bae20..124c646 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -96,8 +96,9 @@ static void directory_initiate_command_rend(const char *address,
 
 /********* END VARIABLES ************/
 
-/** Return true iff the directory purpose 'purpose' must use an
- * anonymous connection to a directory. */
+/** Return true iff the directory purpose <b>dir_purpose</b> (and if it's
+ * fetching descriptors, it's fetching them for <b>router_purpose</b>)
+ * must use an anonymous connection to a directory. */
 static int
 purpose_needs_anonymity(uint8_t dir_purpose, uint8_t router_purpose)
 {
@@ -229,7 +230,7 @@ directories_have_accepted_server_descriptor(void)
 
 /** Start a connection to every suitable directory authority, using
  * connection purpose 'purpose' and uploading the payload 'payload'
- * (length 'payload_len').  The purpose should be one of
+ * (length 'payload_len').  dir_purpose should be one of
  * 'DIR_PURPOSE_UPLOAD_DIR' or 'DIR_PURPOSE_UPLOAD_RENDDESC'.
  *
  * <b>type</b> specifies what sort of dir authorities (V1, V2,
@@ -664,7 +665,7 @@ connection_dir_download_cert_failed(dir_connection_t *conn, int status)
  * 1) If or_port is 0, or it's a direct conn and or_port is firewalled
  *    or we're a dir mirror, no.
  * 2) If we prefer to avoid begindir conns, and we're not fetching or
- * publishing a bridge relay descriptor, no.
+ *    publishing a bridge relay descriptor, no.
  * 3) Else yes.
  */
 static int
@@ -919,7 +920,7 @@ directory_get_consensus_url(int supports_conditional_consensus)
 }
 
 /** Queue an appropriate HTTP command on conn-\>outbuf.  The other args
- * are as in directory_initiate_command.
+ * are as in directory_initiate_command().
  */
 static void
 directory_send_command(dir_connection_t *conn,
@@ -1147,7 +1148,7 @@ parse_http_url(const char *headers, char **url)
     if (s-tmp >= 3 && !strcmpstart(tmp,"://")) {
       tmp = strchr(tmp+3, '/');
       if (tmp && tmp < s) {
-        log_debug(LD_DIR,"Skipping over 'http[s]://hostname' string");
+        log_debug(LD_DIR,"Skipping over 'http[s]://hostname/' string");
         start = tmp;
       }
     }
@@ -1550,7 +1551,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
     v2_networkstatus_source_t source;
     char *cp;
     log_info(LD_DIR,"Received networkstatus objects (size %d) from server "
-             "'%s:%d'",(int) body_len, conn->_base.address, conn->_base.port);
+             "'%s:%d'", (int)body_len, conn->_base.address, conn->_base.port);
     if (status_code != 200) {
       log_warn(LD_DIR,
            "Received http status code %d (%s) from server "
@@ -1624,7 +1625,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
       return -1;
     }
     log_info(LD_DIR,"Received consensus directory (size %d) from server "
-             "'%s:%d'",(int) body_len, conn->_base.address, conn->_base.port);
+             "'%s:%d'", (int)body_len, conn->_base.address, conn->_base.port);
     if ((r=networkstatus_set_current_consensus(body, "ns", 0))<0) {
       log_fn(r<-1?LOG_WARN:LOG_INFO, LD_DIR,
              "Unable to load consensus directory downloaded from "
@@ -1652,7 +1653,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
       return -1;
     }
     log_info(LD_DIR,"Received authority certificates (size %d) from server "
-             "'%s:%d'",(int) body_len, conn->_base.address, conn->_base.port);
+             "'%s:%d'", (int)body_len, conn->_base.address, conn->_base.port);
     if (trusted_dirs_load_certs_from_string(body, 0, 1)<0) {
       log_warn(LD_DIR, "Unable to parse fetched certificates");
       /* if we fetched more than one and only some failed, the successful
@@ -1667,7 +1668,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
     const char *msg;
     int st;
     log_info(LD_DIR,"Got votes (size %d) from server %s:%d",
-             (int) body_len, conn->_base.address, conn->_base.port);
+             (int)body_len, conn->_base.address, conn->_base.port);
     if (status_code != 200) {
       log_warn(LD_DIR,
              "Received http status code %d (%s) from server "
@@ -1687,7 +1688,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
   if (conn->_base.purpose == DIR_PURPOSE_FETCH_DETACHED_SIGNATURES) {
     const char *msg = NULL;
     log_info(LD_DIR,"Got detached signatures (size %d) from server %s:%d",
-             (int) body_len, conn->_base.address, conn->_base.port);
+             (int)body_len, conn->_base.address, conn->_base.port);
     if (status_code != 200) {
       log_warn(LD_DIR,
         "Received http status code %d (%s) from server '%s:%d' while fetching "
@@ -2303,7 +2304,7 @@ directory_dump_request_log(void)
 }
 #endif
 
-/** Decide whether a client would accept the consensus we have
+/** Decide whether a client would accept the consensus we have.
  *
  * Clients can say they only want a consensus if it's signed by more
  * than half the authorities in a list.  They pass this list in
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index b7f6713..3024612 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -72,7 +72,7 @@ static int dirserv_add_extrainfo(extrainfo_t *ei, const char **msg);
 #define FP_INVALID 2  /**< Believed invalid. */
 #define FP_REJECT  4  /**< We will not publish this router. */
 #define FP_BADDIR  8  /**< We'll tell clients to avoid using this as a dir. */
-#define FP_BADEXIT 16  /**< We'll tell clients not to use this as an exit. */
+#define FP_BADEXIT 16 /**< We'll tell clients not to use this as an exit. */
 #define FP_UNNAMED 32 /**< Another router has this name in fingerprint file. */
 
 /** Encapsulate a nickname and an FP_* status; target of status_by_digest
@@ -102,7 +102,7 @@ authdir_config_new(void)
   return list;
 }
 
-/** Add the fingerprint <b>fp</b> for the nickname <b>nickname</b> to
+/** Add the fingerprint <b>fp</b> for <b>nickname</b> to
  * the smartlist of fingerprint_entry_t's <b>list</b>. Return 0 if it's
  * new, or 1 if we replaced the old value.
  */
@@ -184,8 +184,7 @@ dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk)
  * file.  The file format is line-based, with each non-blank holding one
  * nickname, some space, and a fingerprint for that nickname.  On success,
  * replace the current fingerprint list with the new list and return 0.  On
- * failure, leave the current fingerprint list untouched, and
- * return -1. */
+ * failure, leave the current fingerprint list untouched, and return -1. */
 int
 dirserv_load_fingerprint_file(void)
 {
-- 
1.6.5




More information about the tor-commits mailing list