From: Nick Mathewson Date: Tue, 2 Feb 2010 22:49:42 +0000 (-0500) Subject: Fix a couple of bufferevent incompatibilities that snuck in. X-Git-Tag: tor-0.2.3.1-alpha~362^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ec959c9c1d2b0a872926a3cafe42742520397a;p=thirdparty%2Ftor.git Fix a couple of bufferevent incompatibilities that snuck in. --- diff --git a/src/or/connection.c b/src/or/connection.c index b5496d72d5..2944a0d4bb 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 263103662c..f6f26b05f9 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: