[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] reformat routerparse a bit
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or
Modified Files:
routerparse.c
Log Message:
reformat routerparse a bit
Index: routerparse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- routerparse.c 2 May 2005 21:22:31 -0000 1.107
+++ routerparse.c 2 May 2005 21:48:25 -0000 1.108
@@ -837,7 +837,8 @@
}
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 @@
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 @@
}
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 @@
}
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.");