diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-04-12 10:10:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-04-14 16:25:06 -0400 |
commit | 532820b11c9d0566b45b3dd19f01cf3e16d984ef (patch) | |
tree | 538a0286a23c25ed22fcd77b64750c471d3a7b05 /src/or/connection.c | |
parent | a885271c08d2337b35c203c0b27509d0aa32dbf6 (diff) | |
download | tor-532820b11c9d0566b45b3dd19f01cf3e16d984ef.tar.gz tor-532820b11c9d0566b45b3dd19f01cf3e16d984ef.zip |
Add a BUG macro for usage in if checks.
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 78178f92fb..1bd1a92e39 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -665,9 +665,7 @@ connection_free,(connection_t *conn)) return; tor_assert(!connection_is_on_closeable_list(conn)); tor_assert(!connection_in_array(conn)); - if (conn->linked_conn) { - log_err(LD_BUG, "Called with conn->linked_conn still set."); - tor_fragile_assert(); + if (BUG(conn->linked_conn)) { conn->linked_conn->linked_conn = NULL; if (! conn->linked_conn->marked_for_close && conn->linked_conn->reading_from_linked_conn) @@ -3644,7 +3642,7 @@ connection_read_to_buf(connection_t *conn, ssize_t *max_to_read, * take us over our read allotment, but really we shouldn't be * believing that SSL bytes are the same as TCP bytes anyway. */ int r2 = read_to_buf_tls(or_conn->tls, pending, conn->inbuf); - if (r2<0) { + if (BUG(r2<0)) { log_warn(LD_BUG, "apparently, reading pending bytes can fail."); return -1; } |