From cfeb1db2fb881db85a11d80e70a1a14c62b46950 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 14 Mar 2016 12:53:21 -0400 Subject: Add comments to connection_check_event(). --- src/or/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/or/main.c b/src/or/main.c index 1200b55e2e..89e5a512b3 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -506,14 +506,24 @@ connection_is_reading(connection_t *conn) (conn->read_event && event_pending(conn->read_event, EV_READ, NULL)); } +/** Check whether conn is correct in having (or not having) a + * read/write event (passed in evtype == CONN_TYPE_AP && TO_EDGE_CONN(conn)->is_dns_request) { + /* DNS requests which we launch through the dnsserv.c module do not have + * any underlying socket or any underlying linked connection, so they + * shouldn't have any attached events either. + */ bad = ev != NULL; } else { + /* Everytyhing else should have an underlying socket, or a linked + * connection (which is also tracked with a read_event/write_event pair). + */ bad = ev == NULL; } -- cgit v1.2.3-54-g00ecf