aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/connection.c8
-rw-r--r--src/or/dns.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 211152a68..2644a60e6 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -778,7 +778,7 @@ void assert_connection_ok(connection_t *conn, time_t now)
if(conn->state == OR_CONN_STATE_OPEN) {
assert(conn->bandwidth > 0);
assert(conn->receiver_bucket >= 0);
- assert(conn->receiver_bucket <= 10*conn->bandwidth);
+// assert(conn->receiver_bucket <= 10*conn->bandwidth);
}
assert(conn->addr && conn->port);
assert(conn->address);
@@ -795,14 +795,11 @@ void assert_connection_ok(connection_t *conn, time_t now)
assert(!conn->done_sending);
assert(!conn->done_receiving);
} else {
- assert(!conn->next_stream ||
- conn->next_stream->type == CONN_TYPE_EXIT ||
- conn->next_stream->type == CONN_TYPE_AP);
if(conn->type == CONN_TYPE_AP && conn->state == AP_CONN_STATE_OPEN)
assert(conn->cpath_layer);
if(conn->cpath_layer)
assert_cpath_layer_ok(conn->cpath_layer);
- /* XXX unchecked, package window, deliver window. */
+ /* XXX unchecked: package window, deliver window. */
}
if (conn->type != CONN_TYPE_AP) {
assert(!conn->socks_request);
@@ -835,6 +832,7 @@ void assert_connection_ok(connection_t *conn, time_t now)
case CONN_TYPE_DNSWORKER:
assert(conn->state == DNSWORKER_STATE_IDLE ||
conn->state == DNSWORKER_STATE_BUSY);
+ break;
case CONN_TYPE_CPUWORKER:
assert(conn->state >= _CPUWORKER_STATE_MIN &&
conn->state <= _CPUWORKER_STATE_MAX);
diff --git a/src/or/dns.c b/src/or/dns.c
index f2eb411e5..1475ab84c 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -337,9 +337,7 @@ static void dns_found_answer(char *address, uint32_t addr) {
if(connection_edge_end(pend->conn, END_STREAM_REASON_RESOLVEFAILED, NULL) < 0)
log_fn(LOG_WARN,"1: I called connection_edge_end redundantly.");
} else {
- /* XXX should call assert_connection_ok here */
- assert(pend->conn->type >= _CONN_TYPE_MIN);
- assert(pend->conn->type <= _CONN_TYPE_MAX);
+ assert_connection_ok(pend->conn, time(NULL));
connection_exit_connect(pend->conn);
}
resolve->pending_connections = pend->next;