[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master 05/38] New bufferevent-related check in assert_connection_ok().



Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri, 31 Jul 2009 12:01:57 -0400
Subject: New bufferevent-related check in assert_connection_ok().
Commit: 5448501479b61c0ed365b4a96ce9442125c397b9

{Make sure that if we have a bufferevent on a connection, we do not have the
other libevent/buffering-related fields set.}
---
 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 861e0c6..d6b89f1 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);
-- 
1.7.1