aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-08-20 11:39:22 -0400
committerNick Mathewson <nickm@torproject.org>2009-10-15 15:17:13 -0400
commita7ba02f3f1dc267be81bf36f16bc1e69b34af050 (patch)
treef9bc22a0019482fa9653a05dfa71d34eab39ffef /src/or/routerparse.c
parentbdf48393956db2827eb4340e2484cc28282b3f34 (diff)
downloadtor-a7ba02f3f1dc267be81bf36f16bc1e69b34af050.tar.gz
tor-a7ba02f3f1dc267be81bf36f16bc1e69b34af050.zip
Add ability to parse one or more m line from a vote.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index bfcf20b09c..dd0d32ef63 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -55,6 +55,7 @@ typedef enum {
K_S,
K_V,
K_W,
+ K_M,
K_EVENTDNS,
K_EXTRA_INFO,
K_EXTRA_INFO_DIGEST,
@@ -321,6 +322,7 @@ static token_rule_t rtrstatus_token_table[] = {
T1( "s", K_S, ARGS, NO_OBJ ),
T01("v", K_V, CONCAT_ARGS, NO_OBJ ),
T01("w", K_W, ARGS, NO_OBJ ),
+ T0N("m", K_M, CONCAT_ARGS, NO_OBJ ),
T0N("opt", K_OPT, CONCAT_ARGS, OBJ_OK ),
END_OF_TABLE
};
@@ -2050,6 +2052,18 @@ routerstatus_parse_entry_from_string(memarea_t *area,
rs->has_exitsummary = 1;
}
+ if (vote_rs) {
+ SMARTLIST_FOREACH_BEGIN(tokens, directory_token_t *, t) {
+ if (t->tp == K_M && t->n_args) {
+ vote_microdesc_hash_t *line =
+ tor_malloc(sizeof(vote_microdesc_hash_t));
+ line->next = vote_rs->microdesc;
+ line->microdesc_hash_line = tor_strdup(t->args[0]);
+ vote_rs->microdesc = line;
+ }
+ } SMARTLIST_FOREACH_END(t);
+ }
+
if (!strcasecmp(rs->nickname, UNNAMED_ROUTER_NICKNAME))
rs->is_named = 0;