diff options
author | Roger Dingledine <arma@torproject.org> | 2008-06-10 23:13:14 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2008-06-10 23:13:14 +0000 |
commit | 15680ce8d23309a42643fa145088be21c11835d1 (patch) | |
tree | 44c29ccd51fd2e8bd3ed70577365c6e3116b054c /src/or/control.c | |
parent | 45cc25c0196aea33bfd207123cf2e128114dafd2 (diff) | |
download | tor-15680ce8d23309a42643fa145088be21c11835d1.tar.gz tor-15680ce8d23309a42643fa145088be21c11835d1.zip |
some cleanups in preparation for moving stuff around
svn:r15112
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/or/control.c b/src/or/control.c index 89f681979a..9b6c99cdd3 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -3266,32 +3266,32 @@ control_tls_error_to_reason(int e) } /** Convert the reason for ending an OR connection <b>r</b> into the format - * used in ORCONN events. Return NULL if the reason is unrecognized. */ + * used in ORCONN events. Return "UNKNOWN" if the reason is unrecognized. */ static const char * or_conn_end_reason_to_string(int r) { switch (r) { case END_OR_CONN_REASON_DONE: - return "REASON=DONE"; + return "DONE"; case END_OR_CONN_REASON_TCP_REFUSED: - return "REASON=CONNECTREFUSED"; + return "CONNECTREFUSED"; case END_OR_CONN_REASON_OR_IDENTITY: - return "REASON=IDENTITY"; + return "IDENTITY"; case END_OR_CONN_REASON_TLS_CONNRESET: - return "REASON=CONNECTRESET"; + return "CONNECTRESET"; case END_OR_CONN_REASON_TLS_TIMEOUT: - return "REASON=TIMEOUT"; + return "TIMEOUT"; case END_OR_CONN_REASON_TLS_NO_ROUTE: - return "REASON=NOROUTE"; + return "NOROUTE"; case END_OR_CONN_REASON_TLS_IO_ERROR: - return "REASON=IOERROR"; + return "IOERROR"; case END_OR_CONN_REASON_TLS_MISC: - return "REASON=MISC"; + return "MISC"; case 0: return ""; default: log_warn(LD_BUG, "Unrecognized or_conn reason code %d", r); - return "REASON=BOGUS"; + return "UNKNOWN"; } } @@ -3333,15 +3333,17 @@ control_event_or_conn_status(or_connection_t *conn, or_conn_status_event_t tp, if (EVENT_IS_INTERESTING1S(EVENT_OR_CONN_STATUS)) { orconn_target_get_name(0, name, sizeof(name), conn); send_control_event_extended(EVENT_OR_CONN_STATUS, SHORT_NAMES, - "650 ORCONN %s %s@%s%s\r\n", + "650 ORCONN %s %s@%s%s%s\r\n", name, status, + reason ? "REASON=" : "", or_conn_end_reason_to_string(reason), ncircs_buf); } if (EVENT_IS_INTERESTING1L(EVENT_OR_CONN_STATUS)) { orconn_target_get_name(1, name, sizeof(name), conn); send_control_event_extended(EVENT_OR_CONN_STATUS, LONG_NAMES, - "650 ORCONN %s %s@%s%s\r\n", + "650 ORCONN %s %s@%s%s%s\r\n", name, status, + reason ? "REASON=" : "", or_conn_end_reason_to_string(reason), ncircs_buf); } @@ -3976,7 +3978,7 @@ control_event_bootstrap_problem(const char *warn, int reason) status, summary, warn, or_conn_end_reason_to_string(reason)); control_event_client_status(LOG_WARN, - "BOOTSTRAP PROGRESS=%d TAG=%s SUMMARY=\"%s\" WARNING=\"%s\" %s", + "BOOTSTRAP PROGRESS=%d TAG=%s SUMMARY=\"%s\" WARNING=\"%s\" REASON=%s", bootstrap_percent, tag, summary, warn, or_conn_end_reason_to_string(reason)); } |