|
@@ -1086,21 +1086,21 @@ circuit_list_path_impl(origin_circuit_t *circ, int verbose, int verbose_names)
|
|
crypt_path_t *hop;
|
|
crypt_path_t *hop;
|
|
smartlist_t *elements;
|
|
smartlist_t *elements;
|
|
const char *states[] = {"closed", "waiting for keys", "open"};
|
|
const char *states[] = {"closed", "waiting for keys", "open"};
|
|
- char buf[128];
|
|
|
|
char *s;
|
|
char *s;
|
|
|
|
|
|
elements = smartlist_create();
|
|
elements = smartlist_create();
|
|
|
|
|
|
if (verbose) {
|
|
if (verbose) {
|
|
const char *nickname = build_state_get_exit_nickname(circ->build_state);
|
|
const char *nickname = build_state_get_exit_nickname(circ->build_state);
|
|
- tor_snprintf(buf, sizeof(buf), "%s%s circ (length %d%s%s):",
|
|
|
|
|
|
+ char *cp;
|
|
|
|
+ tor_asprintf(&cp, "%s%s circ (length %d%s%s):",
|
|
circ->build_state->is_internal ? "internal" : "exit",
|
|
circ->build_state->is_internal ? "internal" : "exit",
|
|
circ->build_state->need_uptime ? " (high-uptime)" : "",
|
|
circ->build_state->need_uptime ? " (high-uptime)" : "",
|
|
circ->build_state->desired_path_len,
|
|
circ->build_state->desired_path_len,
|
|
circ->_base.state == CIRCUIT_STATE_OPEN ? "" : ", exit ",
|
|
circ->_base.state == CIRCUIT_STATE_OPEN ? "" : ", exit ",
|
|
circ->_base.state == CIRCUIT_STATE_OPEN ? "" :
|
|
circ->_base.state == CIRCUIT_STATE_OPEN ? "" :
|
|
(nickname?nickname:"*unnamed*"));
|
|
(nickname?nickname:"*unnamed*"));
|
|
- smartlist_add(elements, tor_strdup(buf));
|
|
|
|
|
|
+ smartlist_add(elements, cp);
|
|
}
|
|
}
|
|
|
|
|
|
hop = circ->cpath;
|
|
hop = circ->cpath;
|
|
@@ -3067,21 +3067,21 @@ static void
|
|
log_entry_guards(int severity)
|
|
log_entry_guards(int severity)
|
|
{
|
|
{
|
|
smartlist_t *elements = smartlist_create();
|
|
smartlist_t *elements = smartlist_create();
|
|
- char buf[1024];
|
|
|
|
char *s;
|
|
char *s;
|
|
|
|
|
|
SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e,
|
|
SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e,
|
|
{
|
|
{
|
|
const char *msg = NULL;
|
|
const char *msg = NULL;
|
|
|
|
+ char *cp;
|
|
if (entry_is_live(e, 0, 1, 0, &msg))
|
|
if (entry_is_live(e, 0, 1, 0, &msg))
|
|
- tor_snprintf(buf, sizeof(buf), "%s (up %s)",
|
|
|
|
|
|
+ tor_asprintf(&cp, "%s (up %s)",
|
|
e->nickname,
|
|
e->nickname,
|
|
e->made_contact ? "made-contact" : "never-contacted");
|
|
e->made_contact ? "made-contact" : "never-contacted");
|
|
else
|
|
else
|
|
- tor_snprintf(buf, sizeof(buf), "%s (%s, %s)",
|
|
|
|
|
|
+ tor_asprintf(&cp, "%s (%s, %s)",
|
|
e->nickname, msg,
|
|
e->nickname, msg,
|
|
e->made_contact ? "made-contact" : "never-contacted");
|
|
e->made_contact ? "made-contact" : "never-contacted");
|
|
- smartlist_add(elements, tor_strdup(buf));
|
|
|
|
|
|
+ smartlist_add(elements, cp);
|
|
});
|
|
});
|
|
|
|
|
|
s = smartlist_join_strings(elements, ",", 0, NULL);
|
|
s = smartlist_join_strings(elements, ",", 0, NULL);
|