Przeglądaj źródła

Fix a couple of bufferevent incompatibilities that snuck in.

Nick Mathewson 15 lat temu
rodzic
commit
98ec959c9c
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 2 2
      src/or/connection.c
  2. 4 0
      src/or/main.c

+ 2 - 2
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;

+ 4 - 0
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: