Fix log message saying what fraction of paths we can likely build
When trying to get Shadow working with Tor master, Rob and I came across this strange log message: ``` [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 5/5, and can only build 020274120f likely paths. (We have 05001111756f guards bw, 1005016602000f midpoint bw, and 013634243140f exit bw.) ``` I tried various things, but didn't find out how to fix this. Here's a workaround that may help track down the bug: ``` diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 178f084..d566fd9 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -1373,9 +1373,9 @@ compute_frac_paths_available(const networkstatus_t *consensus, f_exit = f_myexit; tor_asprintf(status_out, - "%d%% of guards bw, " - "%d%% of midpoint bw, and " - "%d%% of exit bw", + "%d percent of guards bw, " + "%d percent of midpoint bw, and " + "%d percent of exit bw", (int)(f_guard*100), (int)(f_mid*100), (int)(f_exit*100)); @@ -1471,7 +1471,7 @@ update_router_have_minimum_dir_info(void) if (paths < get_frac_paths_needed_for_circs(options,consensus)) { tor_snprintf(dir_info_status, sizeof(dir_info_status), "We need more %sdescriptors: we have %d/%d, and " - "can only build %d%% of likely paths. (We have %s.)", + "can only build %d percent of likely paths. (We have %s.)", using_md?"micro":"", num_present, num_usable, (int)(paths*100), status); /* log_notice(LD_NET, "%s", dir_info_status); */ ``` Output is now: ``` [notice] I learned some more directory information, but not enough to build a circuit: We need more descriptors: we have 4/5, and can only build 46 percent of likely paths. (We have 55 percent of guards bw, 84 percent of midpoint bw, and 100 percent of exit bw.) ```
issue