diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-07-31 12:01:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-27 12:28:43 -0400 |
commit | 5448501479b61c0ed365b4a96ce9442125c397b9 (patch) | |
tree | c78b14cf135a4d0884389a29ca4f1f699f7633a9 /src/or/connection.c | |
parent | 076025476ae7facae4c4fcc6211f1faaa615589f (diff) | |
download | tor-5448501479b61c0ed365b4a96ce9442125c397b9.tar.gz tor-5448501479b61c0ed365b4a96ce9442125c397b9.zip |
New bufferevent-related check in assert_connection_ok().
{Make sure that if we have a bufferevent on a connection, we do not have the
other libevent/buffering-related fields set.}
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 861e0c6231..d6b89f1f7d 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -3406,6 +3406,16 @@ assert_connection_ok(connection_t *conn, time_t now) tor_assert(conn); tor_assert(conn->type >= _CONN_TYPE_MIN); tor_assert(conn->type <= _CONN_TYPE_MAX); + +#ifdef USE_BUFFEREVENT + if (conn->bufev) { + tor_assert(conn->read_event == NULL); + tor_assert(conn->write_event == NULL); + tor_assert(conn->inbuf == NULL); + tor_assert(conn->outbuf == NULL); + } +#endif + switch (conn->type) { case CONN_TYPE_OR: tor_assert(conn->magic == OR_CONNECTION_MAGIC); |