aboutsummaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-17 16:35:07 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-17 16:35:07 -0500
commit6e8c2a3e46e3578b0268d422b1753995d18fb734 (patch)
tree0f2952090d871b437021d2f6c6059e78234fa0f5 /src/or/dns.c
parent1e923dd2fbdc0834b8fb3ba97b658f15a6d5f6b4 (diff)
downloadtor-6e8c2a3e46e3578b0268d422b1753995d18fb734.tar.gz
tor-6e8c2a3e46e3578b0268d422b1753995d18fb734.zip
Use SOCKET_OK macros in even more places
Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533.
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index beb110acb2..7a505b0c05 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -454,7 +454,7 @@ purge_expired_resolves(time_t now)
pend = resolve->pending_connections;
resolve->pending_connections = pend->next;
/* Connections should only be pending if they have no socket. */
- tor_assert(pend->conn->_base.s == -1);
+ tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);
pendconn = pend->conn;
connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT);
circuit_detach_stream(circuit_get_by_edge_conn(pendconn), pendconn);
@@ -681,7 +681,7 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
uint8_t is_reverse = 0;
int r;
assert_connection_ok(TO_CONN(exitconn), 0);
- tor_assert(exitconn->_base.s == -1);
+ tor_assert(exitconn->_base.s == TOR_INVALID_SOCKET);
assert_cache_ok();
tor_assert(oncirc);
@@ -849,7 +849,7 @@ assert_all_pending_dns_resolves_ok(void)
pend;
pend = pend->next) {
assert_connection_ok(TO_CONN(pend->conn), 0);
- tor_assert(pend->conn->_base.s == -1);
+ tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);
tor_assert(!connection_in_array(TO_CONN(pend->conn)));
}
}
@@ -955,7 +955,7 @@ dns_cancel_pending_resolve(const char *address)
pend->conn->_base.state = EXIT_CONN_STATE_RESOLVEFAILED;
pendconn = pend->conn;
assert_connection_ok(TO_CONN(pendconn), 0);
- tor_assert(pendconn->_base.s == -1);
+ tor_assert(pendconn->_base.s == TOR_INVALID_SOCKET);
if (!pendconn->_base.marked_for_close) {
connection_edge_end(pendconn, END_STREAM_REASON_RESOLVEFAILED);
}