make router_dump_token only for debugging; clean backslashes

svn:r287
This commit is contained in:
Roger Dingledine 2003-05-09 02:20:16 +00:00
parent 6973ccb59b
commit 9f38ba196c
3 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,7 @@ void directory_initiate_fetch(routerinfo_t *router) {
if (router->signing_pkey)
conn->pkey = crypto_pk_dup_key(router->signing_pkey);
else {
log(LOG_ERR, "No signing key known for directory %s; signature won\'t be checked", conn->address);
log(LOG_ERR, "No signing key known for directory %s; signature won't be checked", conn->address);
conn->pkey = NULL;
}

View File

@ -654,7 +654,7 @@ build_directory(directory_t *dir) {
routers = (routerinfo_t**) malloc(sizeof(routerinfo_t*) * (nfds+1));
if (!routers) {
log(LOG_ERR, "build_directory(): couldn\'t allocate space for routerinfo");
log(LOG_ERR, "build_directory(): couldn't allocate space for routerinfo");
return -1;
}
if (my_routerinfo) {
@ -671,7 +671,7 @@ build_directory(directory_t *dir) {
continue; /* we only want to list ones that successfully handshaked */
router = router_get_by_addr_port(conn->addr,conn->port);
if(!router) {
log(LOG_ERR,"build_directory(): couldn\'t find router %d:%d!",
log(LOG_ERR,"build_directory(): couldn't find router %d:%d!",
conn->addr,conn->port);
continue;
}
@ -735,11 +735,11 @@ dump_signed_directory_to_string_impl(char *s, int maxlen, directory_t *dir,
cp = s + i;
if (crypto_SHA_digest(s, i, digest)) {
log(LOG_ERR,"dump_signed_directory_to_string(): couldn\'t compute digest");
log(LOG_ERR,"dump_signed_directory_to_string(): couldn't compute digest");
return -1;
}
if (crypto_pk_private_sign(private_key, digest, 20, signature) < 0) {
log(LOG_ERR,"dump_signed_directory_to_string(): couldn\'t sign digest");
log(LOG_ERR,"dump_signed_directory_to_string(): couldn't sign digest");
return -1;
}
@ -749,7 +749,7 @@ dump_signed_directory_to_string_impl(char *s, int maxlen, directory_t *dir,
i = strlen(s);
cp = s+i;
if (base64_encode(cp, maxlen-i, signature, 128) < 0) {
log(LOG_ERR,"dump_signed_directory_to_string(): couldn\'t base64-encode signature %d/%d");
log(LOG_ERR,"dump_signed_directory_to_string(): couldn't base64-encode signature %d/%d");
return -1;
}

View File

@ -376,6 +376,7 @@ _router_get_next_token(char **s, directory_token_t *tok) {
}
}
#ifdef DEBUG_ROUTER_TOKENS
static void
router_dump_token(directory_token_t *tok) {
int i;
@ -411,7 +412,6 @@ router_dump_token(directory_token_t *tok) {
return;
}
#ifdef DEBUG_ROUTER_TOKENS
static int
router_get_next_token(char **s, directory_token_t *tok) {
int i;
@ -511,7 +511,7 @@ static int router_get_dir_hash(char *s, char *digest)
int router_get_dir_from_string(char *s, crypto_pk_env_t *pkey)
{
if (router_get_dir_from_string_impl(s, &directory, pkey)) {
log(LOG_ERR, "router_get_dir_from_string: Couldn\'t parse directory.");
log(LOG_ERR, "router_get_dir_from_string: Couldn't parse directory.");
return -1;
}
if (router_resolve_directory(directory)) {
@ -660,7 +660,7 @@ router_resolve_directory(directory_t *dir)
for (i = 0; i < max; ++i) {
remove = 0;
if (router_resolve(dir->routers[i])) {
log(LOG_INFO, "Couldn\'t resolve router %s; removing",
log(LOG_INFO, "Couldn't resolve router %s; removing",
dir->routers[i]->address);
remove = 1;
routerinfo_free(dir->routers[i]);