]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
If we start/stop reading on a dnsserv connection, don't assert.
authorNick Mathewson <nickm@torproject.org>
Fri, 11 Mar 2016 15:33:19 +0000 (10:33 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 Mar 2016 15:33:19 +0000 (10:33 -0500)
Fixes bug 16248. Patch from cypherpunks.  Bugfix on 0.2.0.1-alpha.

src/or/main.c

index 534a6acc51223ee961c94fc49b8c7d8eb212a608..3fb80e1759c915d336a748b2db6f09cffe2cdfb0 100644 (file)
@@ -578,6 +578,12 @@ connection_stop_reading,(connection_t *conn))
       return;
   });
 
+  /* if dummy conn then no socket and no event, nothing to do here */
+  if (conn->type == CONN_TYPE_AP && TO_EDGE_CONN(conn)->is_dns_request) {
+    tor_assert(!conn->read_event);
+    return;
+  }
+
   tor_assert(conn->read_event);
 
   if (conn->linked) {
@@ -603,6 +609,12 @@ connection_start_reading,(connection_t *conn))
       return;
   });
 
+  /* if dummy conn then no socket and no event, nothing to do here */
+  if (conn->type == CONN_TYPE_AP && TO_EDGE_CONN(conn)->is_dns_request) {
+    tor_assert(!conn->read_event);
+    return;
+  }
+
   tor_assert(conn->read_event);
 
   if (conn->linked) {