]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
minor cleanups
authorRoger Dingledine <arma@torproject.org>
Sun, 2 Dec 2007 04:39:56 +0000 (04:39 +0000)
committerRoger Dingledine <arma@torproject.org>
Sun, 2 Dec 2007 04:39:56 +0000 (04:39 +0000)
svn:r12631

src/or/directory.c
src/or/dirserv.c
src/or/or.h
src/or/routerlist.c

index c23de6833124f1379734e35d9a209e1dbfe1e91f..adfea43e63d8a0d2b5a25be967d63a21f6834ae9 100644 (file)
@@ -2740,7 +2740,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers,
   }
 
   if (authdir_mode_v3(options) &&
-      !strcmp(url,"/tor/post/vote")) { /* server descriptor post */
+      !strcmp(url,"/tor/post/vote")) { /* v3 networkstatus vote */
     const char *msg = "OK";
     int status;
     if (dirvote_add_vote(body, &msg, &status)) {
index a040b6263df1405cce1888e823cbdb50d2c73a8c..b48dd142a49d4925cfef33444fb58707dbfe7404 100644 (file)
@@ -557,7 +557,7 @@ dirserv_add_multiple_descriptors(const char *desc, uint8_t purpose,
   const char *s;
   int n_parsed = 0;
   time_t now = time(NULL);
-  char annotation_buf[256];
+  char annotation_buf[ROUTER_ANNOTATION_BUF_LEN];
   char time_buf[ISO_TIME_LEN+1];
   int general = purpose == ROUTER_PURPOSE_GENERAL;
   tor_assert(msg);
index 6f8e40be12369553d4a4d2e0dcd75f5bee7adcd9..acbe2758e3d6bc2ca42df8f61560b42fd275e9be 100644 (file)
@@ -1185,21 +1185,26 @@ typedef struct download_status_t {
   download_schedule_t schedule : 1;
 } download_status_t;
 
+/** The max size we expect router descriptor annotations we create to
+ * be. We'll accept larger ones if we see them on disk, but we won't
+ * create any that are larger than this. */
+#define ROUTER_ANNOTATION_BUF_LEN 256
+
 /** Information need to cache an onion router's descriptor. */
 typedef struct signed_descriptor_t {
-  /** Pointer to the raw server descriptor, preceeded by annotatinos.  Not
+  /** Pointer to the raw server descriptor, preceded by annotations.  Not
    * necessarily NUL-terminated.  If saved_location is SAVED_IN_CACHE, this
-   * pointer is null.  */
+   * pointer is null. */
   char *signed_descriptor_body;
   /** Length of the annotations preceeding the server descriptor. */
   size_t annotations_len;
   /** Length of the server descriptor. */
   size_t signed_descriptor_len;
-  /** Digest of the server descriptor, computed as specified in dir-spec.txt */
+  /** Digest of the server descriptor, computed as specified in dir-spec.txt. */
   char signed_descriptor_digest[DIGEST_LEN];
   /** Identity digest of the router. */
   char identity_digest[DIGEST_LEN];
-  /** Declared publication time of the descriptor */
+  /** Declared publication time of the descriptor. */
   time_t published_on;
   /** For routerdescs only: digest of the corresponding extrainfo. */
   char extra_info_digest[DIGEST_LEN];
index 7239a455c4fbfa5d2f81d3ad0f40460ee1e17c6c..d7d33305bdb71f2dd71e682cd9e86fec376427b8 100644 (file)
@@ -3065,7 +3065,7 @@ router_load_single_router(const char *s, uint8_t purpose, int cache,
   routerinfo_t *ri;
   int r;
   smartlist_t *lst;
-  char annotation_buf[256];
+  char annotation_buf[ROUTER_ANNOTATION_BUF_LEN];
   tor_assert(msg);
   *msg = NULL;