aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-06-04 03:31:12 -0400
committerNick Mathewson <nickm@torproject.org>2009-06-04 03:31:12 -0400
commit4945fee65a406e0f95f451909c4848b4387ecf4a (patch)
tree476557cdbc95f7cbce0cf1bc8c822330cc06b8b0 /src/or
parent77ffd6b2a7bb8450c033763e2eb4d7f0ed7a5757 (diff)
parent48bf1d97eeed9fd0812e281cbc1f08c6c5ade89c (diff)
downloadtor-4945fee65a406e0f95f451909c4848b4387ecf4a.tar.gz
tor-4945fee65a406e0f95f451909c4848b4387ecf4a.zip
Merge commit 'origin/maint-0.2.1'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/dns.c18
-rw-r--r--src/or/main.c6
2 files changed, 17 insertions, 7 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index fb3620c165..b8dd460889 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -736,15 +736,25 @@ void
assert_connection_edge_not_dns_pending(edge_connection_t *conn)
{
pending_connection_t *pend;
- cached_resolve_t **resolve;
+ cached_resolve_t search;
+#if 1
+ cached_resolve_t *resolve;
+ strlcpy(search.address, conn->_base.address, sizeof(search.address));
+ resolve = HT_FIND(cache_map, &cache_root, &search);
+ if (!resolve)
+ return;
+ for (pend = resolve->pending_connections; pend; pend = pend->next) {
+ tor_assert(pend->conn != conn);
+ }
+#else
+ cached_resolve_t **resolve;
HT_FOREACH(resolve, cache_map, &cache_root) {
- for (pend = (*resolve)->pending_connections;
- pend;
- pend = pend->next) {
+ for (pend = (*resolve)->pending_connections; pend; pend = pend->next) {
tor_assert(pend->conn != conn);
}
}
+#endif
}
/** Log an error and abort if any connection waiting for a DNS resolve is
diff --git a/src/or/main.c b/src/or/main.c
index 25cb949a0c..ee1ff3437b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -451,7 +451,7 @@ conn_read_callback(int fd, short event, void *_conn)
log_debug(LD_NET,"socket %d wants to read.",conn->s);
- assert_connection_ok(conn, time(NULL));
+ /* assert_connection_ok(conn, time(NULL)); */
if (connection_handle_read(conn) < 0) {
if (!conn->marked_for_close) {
@@ -483,7 +483,7 @@ conn_write_callback(int fd, short events, void *_conn)
LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "socket %d wants to write.",conn->s));
- assert_connection_ok(conn, time(NULL));
+ /* assert_connection_ok(conn, time(NULL)); */
if (connection_handle_write(conn, 0) < 0) {
if (!conn->marked_for_close) {
@@ -529,7 +529,7 @@ conn_close_if_marked(int i)
return 0; /* nothing to see here, move along */
now = time(NULL);
assert_connection_ok(conn, now);
- assert_all_pending_dns_resolves_ok();
+ /* assert_all_pending_dns_resolves_ok(); */
log_debug(LD_NET,"Cleaning up connection (fd %d).",conn->s);
if ((conn->s >= 0 || conn->linked_conn) && connection_wants_to_flush(conn)) {