mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
Use !SOCKET_OK to test if a socket is uninitialized
This fixes a compile warning on Windows. Fixes bug 4946, not in any released version.
This commit is contained in:
parent
2de0eeaa72
commit
9ce9836f85
@ -454,7 +454,7 @@ purge_expired_resolves(time_t now)
|
|||||||
pend = resolve->pending_connections;
|
pend = resolve->pending_connections;
|
||||||
resolve->pending_connections = pend->next;
|
resolve->pending_connections = pend->next;
|
||||||
/* Connections should only be pending if they have no socket. */
|
/* Connections should only be pending if they have no socket. */
|
||||||
tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);
|
tor_assert(!SOCKET_OK(pend->conn->_base.s));
|
||||||
pendconn = pend->conn;
|
pendconn = pend->conn;
|
||||||
connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT);
|
connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT);
|
||||||
circuit_detach_stream(circuit_get_by_edge_conn(pendconn), pendconn);
|
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;
|
uint8_t is_reverse = 0;
|
||||||
int r;
|
int r;
|
||||||
assert_connection_ok(TO_CONN(exitconn), 0);
|
assert_connection_ok(TO_CONN(exitconn), 0);
|
||||||
tor_assert(exitconn->_base.s == TOR_INVALID_SOCKET);
|
tor_assert(!SOCKET_OK(exitconn->_base.s));
|
||||||
assert_cache_ok();
|
assert_cache_ok();
|
||||||
tor_assert(oncirc);
|
tor_assert(oncirc);
|
||||||
|
|
||||||
@ -849,7 +849,7 @@ assert_all_pending_dns_resolves_ok(void)
|
|||||||
pend;
|
pend;
|
||||||
pend = pend->next) {
|
pend = pend->next) {
|
||||||
assert_connection_ok(TO_CONN(pend->conn), 0);
|
assert_connection_ok(TO_CONN(pend->conn), 0);
|
||||||
tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);
|
tor_assert(!SOCKET_OK(pend->conn->_base.s));
|
||||||
tor_assert(!connection_in_array(TO_CONN(pend->conn)));
|
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;
|
pend->conn->_base.state = EXIT_CONN_STATE_RESOLVEFAILED;
|
||||||
pendconn = pend->conn;
|
pendconn = pend->conn;
|
||||||
assert_connection_ok(TO_CONN(pendconn), 0);
|
assert_connection_ok(TO_CONN(pendconn), 0);
|
||||||
tor_assert(pendconn->_base.s == TOR_INVALID_SOCKET);
|
tor_assert(!SOCKET_OK(pendconn->_base.s));
|
||||||
if (!pendconn->_base.marked_for_close) {
|
if (!pendconn->_base.marked_for_close) {
|
||||||
connection_edge_end(pendconn, END_STREAM_REASON_RESOLVEFAILED);
|
connection_edge_end(pendconn, END_STREAM_REASON_RESOLVEFAILED);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user