fix encoding in "getinfo addr-mappings" response.

fix error code when "getinfo dir/status/" fails.


svn:r8355
This commit is contained in:
Roger Dingledine 2006-09-09 03:38:03 +00:00
parent 29b6d6560e
commit 0c3cc15898

View File

@ -1518,7 +1518,7 @@ handle_getinfo_helper(const char *question, char **answer)
} }
mappings = smartlist_create(); mappings = smartlist_create();
addressmap_get_mappings(mappings, min_e, max_e); addressmap_get_mappings(mappings, min_e, max_e);
*answer = smartlist_join_strings(mappings, "\n", 0, NULL); *answer = smartlist_join_strings(mappings, "\r\n", 0, NULL);
SMARTLIST_FOREACH(mappings, char *, cp, tor_free(cp)); SMARTLIST_FOREACH(mappings, char *, cp, tor_free(cp));
smartlist_free(mappings); smartlist_free(mappings);
} else if (!strcmp(question, "address")) { } else if (!strcmp(question, "address")) {
@ -1555,7 +1555,7 @@ handle_getinfo_helper(const char *question, char **answer)
char *cp; char *cp;
if (!get_options()->DirPort) { if (!get_options()->DirPort) {
log_warn(LD_CONTROL, "getinfo dir/status/ requires an open dirport."); log_warn(LD_CONTROL, "getinfo dir/status/ requires an open dirport.");
return 0; return -1;
} }
status_list = smartlist_create(); status_list = smartlist_create();
dirserv_get_networkstatus_v2(status_list, dirserv_get_networkstatus_v2(status_list,