aboutsummaryrefslogtreecommitdiff
path: root/src/or/dnsserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-05 17:11:22 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-19 01:58:44 -0400
commitd2205ca458e25115287462292087f0f5ed797c02 (patch)
tree51717e10a5347ccb378b97245797babfdaf24447 /src/or/dnsserv.c
parentddc65e2b3303559ab7b842a176ee6c2eda9e4027 (diff)
downloadtor-d2205ca458e25115287462292087f0f5ed797c02.tar.gz
tor-d2205ca458e25115287462292087f0f5ed797c02.zip
Refactor listener_connection_t into its own type.
This will allow us to add more fields to listener_connection_t without bloating the other connection types.
Diffstat (limited to 'src/or/dnsserv.c')
-rw-r--r--src/or/dnsserv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c
index f2c473dfc5..350b138726 100644
--- a/src/or/dnsserv.c
+++ b/src/or/dnsserv.c
@@ -305,11 +305,13 @@ dnsserv_resolved(edge_connection_t *conn,
void
dnsserv_configure_listener(connection_t *conn)
{
+ listener_connection_t *listener_conn;
tor_assert(conn);
tor_assert(SOCKET_OK(conn->s));
tor_assert(conn->type == CONN_TYPE_AP_DNS_LISTENER);
- conn->dns_server_port =
+ listener_conn = TO_LISTENER_CONN(conn);
+ listener_conn->dns_server_port =
tor_evdns_add_server_port(conn->s, 0, evdns_server_callback, NULL);
}
@@ -318,12 +320,15 @@ dnsserv_configure_listener(connection_t *conn)
void
dnsserv_close_listener(connection_t *conn)
{
+ listener_connection_t *listener_conn;
tor_assert(conn);
tor_assert(conn->type == CONN_TYPE_AP_DNS_LISTENER);
- if (conn->dns_server_port) {
- evdns_close_server_port(conn->dns_server_port);
- conn->dns_server_port = NULL;
+ listener_conn = TO_LISTENER_CONN(conn);
+
+ if (listener_conn->dns_server_port) {
+ evdns_close_server_port(listener_conn->dns_server_port);
+ listener_conn->dns_server_port = NULL;
}
}