[or-cvs] [tor/master 28/38] Fix a couple of bufferevent incompatibilities that snuck in.

nickm at torproject.org nickm at torproject.org
Mon Sep 27 20:51:00 UTC 2010


Author: Nick Mathewson <nickm at torproject.org>
Date: Tue, 2 Feb 2010 17:49:42 -0500
Subject: Fix a couple of bufferevent incompatibilities that snuck in.
Commit: 98ec959c9c1d2b0a872926a3cafe42742520397a

---
 src/or/connection.c |    4 ++--
 src/or/main.c       |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index b5496d7..2944a0d 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -331,13 +331,13 @@ connection_init(time_t now, connection_t *conn, int type, int socket_family)
 
   conn->type = type;
   conn->socket_family = socket_family;
+#ifndef USE_BUFFEREVENTS
   if (!connection_is_listener(conn)) {
     /* listeners never use their buf */
-    /* XXX and bufferevents don't either, but for now we leave this here
-     * so that linked connections can still work. */
     conn->inbuf = buf_new();
     conn->outbuf = buf_new();
   }
+#endif
 
   conn->timestamp_created = now;
   conn->timestamp_lastread = now;
diff --git a/src/or/main.c b/src/or/main.c
index 2631036..f6f26b0 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -925,7 +925,11 @@ run_connection_housekeeping(int i, time_t now)
      the connection or send a keepalive, depending. */
 
   or_conn = TO_OR_CONN(conn);
+#ifdef USE_BUFFEREVENTS
+  tor_assert(conn->bufev);
+#else
   tor_assert(conn->outbuf);
+#endif
 
   if (or_conn->is_bad_for_new_circs && !or_conn->n_circuits) {
     /* It's bad for new circuits, and has no unmarked circuits on it:
-- 
1.7.1




More information about the tor-commits mailing list