[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r12631: minor cleanups (tor/trunk/src/or)
Author: arma
Date: 2007-12-01 23:39:56 -0500 (Sat, 01 Dec 2007)
New Revision: 12631
Modified:
tor/trunk/src/or/directory.c
tor/trunk/src/or/dirserv.c
tor/trunk/src/or/or.h
tor/trunk/src/or/routerlist.c
Log:
minor cleanups
Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c 2007-12-02 02:47:42 UTC (rev 12630)
+++ tor/trunk/src/or/directory.c 2007-12-02 04:39:56 UTC (rev 12631)
@@ -2740,7 +2740,7 @@
}
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)) {
Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c 2007-12-02 02:47:42 UTC (rev 12630)
+++ tor/trunk/src/or/dirserv.c 2007-12-02 04:39:56 UTC (rev 12631)
@@ -557,7 +557,7 @@
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);
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2007-12-02 02:47:42 UTC (rev 12630)
+++ tor/trunk/src/or/or.h 2007-12-02 04:39:56 UTC (rev 12631)
@@ -1185,21 +1185,26 @@
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];
Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c 2007-12-02 02:47:42 UTC (rev 12630)
+++ tor/trunk/src/or/routerlist.c 2007-12-02 04:39:56 UTC (rev 12631)
@@ -3065,7 +3065,7 @@
routerinfo_t *ri;
int r;
smartlist_t *lst;
- char annotation_buf[256];
+ char annotation_buf[ROUTER_ANNOTATION_BUF_LEN];
tor_assert(msg);
*msg = NULL;