]> 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>
Tue, 7 Feb 2017 14:48:13 +0000 (09:48 -0500)
Fixes bug 16248. Patch from cypherpunks.  Bugfix on 0.2.0.1-alpha.

src/or/main.c

index bd23141b9748f248175f0112548e96f1b72b7ad2..a2b032dbcca7744dc52b9872b71e1ef94d114ac4 100644 (file)
@@ -517,6 +517,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) {
@@ -542,6 +548,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) {