diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-10-13 14:22:52 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-10-13 14:31:11 -0400 |
commit | 9df61d7028936257538b15d1d3f8e04a370edb09 (patch) | |
tree | 4af9760910e778f9fb80a928e6de69ad37fc332a /src | |
parent | 500c4063643dd20e0197ad71ab1bebcf251850a1 (diff) | |
download | tor-9df61d7028936257538b15d1d3f8e04a370edb09.tar.gz tor-9df61d7028936257538b15d1d3f8e04a370edb09.zip |
Add comments to can_dl_again usage
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerparse.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 2858c4ce37..76eef789f0 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1100,6 +1100,8 @@ router_parse_entry_from_string(const char *s, const char *end, size_t prepend_len = prepend_annotations ? strlen(prepend_annotations) : 0; int ok = 1; memarea_t *area = NULL; + /* Do not set this to '1' until we have parsed everything that we intend to + * parse that's covered by the hash. */ int can_dl_again = 0; tor_assert(!allow_annotations || !prepend_annotations); @@ -1413,6 +1415,7 @@ router_parse_entry_from_string(const char *s, const char *end, goto err; } + /* We've checked everything that's covered by the hash. */ can_dl_again = 1; if (check_signature_token(digest, DIGEST_LEN, tok, router->identity_pkey, 0, "router descriptor") < 0) @@ -1466,6 +1469,8 @@ extrainfo_parse_entry_from_string(const char *s, const char *end, routerinfo_t *router = NULL; memarea_t *area = NULL; const char *s_dup = s; + /* Do not set this to '1' until we have parsed everything that we intend to + * parse that's covered by the hash. */ int can_dl_again = 0; if (!end) { @@ -1526,6 +1531,7 @@ extrainfo_parse_entry_from_string(const char *s, const char *end, goto err; } + /* We've checked everything that's covered by the hash. */ can_dl_again = 1; if (routermap && |