diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-06-28 15:06:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-11 16:13:17 -0400 |
commit | 3f97c665aa8b0fee06b22160e3c10ef7d896618d (patch) | |
tree | 09f6778b2cbe7408f6913cf119b905dcb6082798 /src/common/tortls.c | |
parent | b0de8560f6f7b54c363226c11d277b6b08b1cbc7 (diff) | |
download | tor-3f97c665aa8b0fee06b22160e3c10ef7d896618d.tar.gz tor-3f97c665aa8b0fee06b22160e3c10ef7d896618d.zip |
Document feature3116 fns and improve output
- We were reporting the _bottom_ N failing states, not the top N.
- With bufferevents enabled, we logged all TLS states as being "in
bufferevent", which isn't actually informative.
- When we had nothing to report, we reported nothing too loudly.
- Also, we needed documentation.
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 8db47a6f21..a208bc7614 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -222,7 +222,8 @@ ssl_state_to_string(int ssl_state) return buf; } -/** DOCDOC 3116 */ +/** Write a description of the current state of <b>tls</b> into the + * <b>sz</b>-byte buffer at <b>buf</b>. */ void tor_tls_get_state_description(tor_tls_t *tls, char *buf, size_t sz) { @@ -236,21 +237,23 @@ tor_tls_get_state_description(tor_tls_t *tls, char *buf, size_t sz) ssl_state = ssl_state_to_string(tls->ssl->state); switch (tls->state) { -#define CASE(st) case TOR_TLS_ST_##st: tortls_state = #st ; break +#define CASE(st) case TOR_TLS_ST_##st: tortls_state = " in "#st ; break CASE(HANDSHAKE); CASE(OPEN); CASE(GOTCLOSE); CASE(SENTCLOSE); CASE(CLOSED); CASE(RENEGOTIATE); - CASE(BUFFEREVENT); #undef CASE + case TOR_TLS_ST_BUFFEREVENT: + tortls_state = ""; + break; default: - tortls_state = "unknown"; + tortls_state = " in unknown TLS state"; break; } - tor_snprintf(buf, sz, "%s in %s", ssl_state, tortls_state); + tor_snprintf(buf, sz, "%s%s", ssl_state, tortls_state); } void |