summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-02 04:39:56 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-02 04:39:56 +0000
commit1a254477fc318f4ad325af90481885e0b5f16505 (patch)
treeff4739c8034ddc51da483766e64b211b15799897 /src
parentf901cd064c77645d30782f331ae48abd0f32eb5b (diff)
downloadtor-1a254477fc318f4ad325af90481885e0b5f16505.tar.gz
tor-1a254477fc318f4ad325af90481885e0b5f16505.zip
minor cleanups
svn:r12631
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/dirserv.c2
-rw-r--r--src/or/or.h13
-rw-r--r--src/or/routerlist.c2
4 files changed, 12 insertions, 7 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index c23de68331..adfea43e63 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -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)) {
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index a040b6263d..b48dd142a4 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -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);
diff --git a/src/or/or.h b/src/or/or.h
index 6f8e40be12..acbe2758e3 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -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];
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 7239a455c4..d7d33305bd 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -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;