[or-cvs] r19079: {tor} Do not generate the non-verbose circuit path when generating (tor/trunk/src/or)
nickm at seul.org
nickm at seul.org
Wed Mar 18 19:30:35 UTC 2009
Author: nickm
Date: 2009-03-18 15:30:34 -0400 (Wed, 18 Mar 2009)
New Revision: 19079
Modified:
tor/trunk/src/or/control.c
Log:
Do not generate the non-verbose circuit path when generating a circuit event unless we will use it.
Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c 2009-03-18 19:30:30 UTC (rev 19078)
+++ tor/trunk/src/or/control.c 2009-03-18 19:30:34 UTC (rev 19079)
@@ -2989,14 +2989,10 @@
const char *status;
char extended_buf[96];
int providing_reason=0;
- char *path=NULL;
if (!EVENT_IS_INTERESTING(EVENT_CIRCUIT_STATUS))
return 0;
tor_assert(circ);
- if (EVENT_IS_INTERESTING1S(EVENT_CIRCUIT_STATUS))
- path = circuit_list_path(circ,0);
-
switch (tp)
{
case CIRC_EVENT_LAUNCHED: status = "LAUNCHED"; break;
@@ -3033,11 +3029,13 @@
}
if (EVENT_IS_INTERESTING1S(EVENT_CIRCUIT_STATUS)) {
+ char *path = circuit_list_path(circ,0);
const char *sp = strlen(path) ? " " : "";
send_control_event_extended(EVENT_CIRCUIT_STATUS, SHORT_NAMES,
"650 CIRC %lu %s%s%s@%s\r\n",
(unsigned long)circ->global_identifier,
status, sp, path, extended_buf);
+ tor_free(path);
}
if (EVENT_IS_INTERESTING1L(EVENT_CIRCUIT_STATUS)) {
char *vpath = circuit_list_path_for_controller(circ);
@@ -3049,8 +3047,6 @@
tor_free(vpath);
}
- tor_free(path);
-
return 0;
}
More information about the tor-commits
mailing list