Use EXIT properly in assert_connection_ok

svn:r465
This commit is contained in:
Nick Mathewson 2003-09-16 19:51:09 +00:00
parent 1b9c2f35eb
commit 4dddac706d

View File

@ -808,7 +808,7 @@ void assert_connection_ok(connection_t *conn, time_t now)
#endif #endif
} }
if (conn->type != CONN_TYPE_EXIT) { if (conn->type != CONN_TYPE_EXIT && conn->type != CONN_TYPE_AP) {
assert(!conn->stream_id[0]); assert(!conn->stream_id[0]);
assert(!conn->next_stream); assert(!conn->next_stream);
assert(!conn->cpath_layer); assert(!conn->cpath_layer);
@ -818,7 +818,8 @@ void assert_connection_ok(connection_t *conn, time_t now)
assert(!conn->done_receiving); assert(!conn->done_receiving);
} else { } else {
assert(!conn->next_stream || assert(!conn->next_stream ||
conn->next_stream->type == CONN_TYPE_EXIT); conn->next_stream->type == CONN_TYPE_EXIT ||
conn->next_stream->type == CONN_TYPE_AP);
assert(conn->cpath_layer); assert(conn->cpath_layer);
assert_cpath_layer_ok(conn->cpath_layer); assert_cpath_layer_ok(conn->cpath_layer);
/* XXX unchecked, package window, deliver window. */ /* XXX unchecked, package window, deliver window. */
@ -847,7 +848,7 @@ void assert_connection_ok(connection_t *conn, time_t now)
conn->state <= _EXIT_CONN_STATE_MAX); conn->state <= _EXIT_CONN_STATE_MAX);
break; break;
case CONN_TYPE_AP: case CONN_TYPE_AP:
assert(conn->state >= _AP_CONN_STATE_MIN && assert(conn->state >= _EXIT_CONN_STATE_MIN &&
conn->state <= _AP_CONN_STATE_MAX); conn->state <= _AP_CONN_STATE_MAX);
break; break;
case CONN_TYPE_DIR: case CONN_TYPE_DIR: