diff options
author | Roger Dingledine <arma@torproject.org> | 2005-05-02 21:48:25 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-05-02 21:48:25 +0000 |
commit | 57b7427c2d9b333462e3e396fcd5d6063d7f189e (patch) | |
tree | 42fd7214d0ae56ac38aeffc349da26c3e30c4cf6 /src | |
parent | 69dc4e167554d3db4f016a5f9d8b9f9b2dc5a6f2 (diff) | |
download | tor-57b7427c2d9b333462e3e396fcd5d6063d7f189e.tar.gz tor-57b7427c2d9b333462e3e396fcd5d6063d7f189e.zip |
reformat routerparse a bit
svn:r4155
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerparse.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 6e615e4f49..d68ff087ab 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -837,7 +837,8 @@ routerinfo_t *router_parse_entry_from_string(const char *s, } tokens = smartlist_create(); if (tokenize_string(s,end,tokens,0)) { - log_fn(LOG_WARN, "Error tokeninzing router descriptor."); goto err; + log_fn(LOG_WARN, "Error tokeninzing router descriptor."); + goto err; } if (smartlist_len(tokens) < 2) { @@ -960,8 +961,9 @@ routerinfo_t *router_parse_entry_from_string(const char *s, exit_policy_tokens = find_all_exitpolicy(tokens); SMARTLIST_FOREACH(exit_policy_tokens, directory_token_t *, t, if (router_add_exit_policy(router,t)<0) { - log_fn(LOG_WARN,"Error in exit policy"); goto err;} - ); + log_fn(LOG_WARN,"Error in exit policy"); + goto err; + }); if ((tok = find_first_by_keyword(tokens, K_FAMILY)) && tok->n_args) { int i; @@ -976,7 +978,8 @@ routerinfo_t *router_parse_entry_from_string(const char *s, } if (!(tok = find_first_by_keyword(tokens, K_ROUTER_SIGNATURE))) { - log_fn(LOG_WARN, "Missing router signature"); goto err; + log_fn(LOG_WARN, "Missing router signature"); + goto err; } if (strcmp(tok->object_type, "SIGNATURE") || tok->object_size != 128) { log_fn(LOG_WARN, "Bad object type or length on router signature"); @@ -984,17 +987,21 @@ routerinfo_t *router_parse_entry_from_string(const char *s, } if ((t=crypto_pk_public_checksig(router->identity_pkey, signed_digest, tok->object_body, 128)) != 20) { - log_fn(LOG_WARN, "Invalid signature %d",t); goto err; + log_fn(LOG_WARN, "Invalid signature %d",t); + goto err; } if (memcmp(digest, signed_digest, 20)) { - log_fn(LOG_WARN, "Mismatched signature"); goto err; + log_fn(LOG_WARN, "Mismatched signature"); + goto err; } if (!ports_set) { - log_fn(LOG_WARN,"No ports declared; failing."); goto err; + log_fn(LOG_WARN,"No ports declared; failing."); + goto err; } if (!bw_set) { - log_fn(LOG_WARN,"No bandwidth declared; failing."); goto err; + log_fn(LOG_WARN,"No bandwidth declared; failing."); + goto err; } if (!router->or_port) { log_fn(LOG_WARN,"or_port unreadable or 0. Failing."); |