소스 검색

If we start/stop reading on a dnsserv connection, don't assert.

Fixes bug 16248. Patch from cypherpunks.  Bugfix on 0.2.0.1-alpha.
Nick Mathewson 8 년 전
부모
커밋
e79da62645
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      src/or/main.c

+ 12 - 0
src/or/main.c

@@ -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) {