diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-02-23 20:35:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-02-23 20:35:26 +0000 |
commit | 22c38b0f9b08e608e1b3203aa1550660746e38a9 (patch) | |
tree | 651047dc98b419ef27ea3405ad203e94a7d5db2d /src/or/connection_edge.c | |
parent | 5dd58e27d99dff786e13649db2a4522ff8210068 (diff) | |
download | tor-22c38b0f9b08e608e1b3203aa1550660746e38a9.tar.gz tor-22c38b0f9b08e608e1b3203aa1550660746e38a9.zip |
Clarify comment. Use CONN_IS_EDGE more. Try to be more zealous about calling connection_edge_end when things go bad with edge conns in connection.c
svn:r3671
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 8505d98f35..01d0630c6a 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -64,7 +64,7 @@ int connection_edge_reached_eof(connection_t *conn) { int connection_edge_process_inbuf(connection_t *conn, int package_partial) { tor_assert(conn); - tor_assert(conn->type == CONN_TYPE_AP || conn->type == CONN_TYPE_EXIT); + tor_assert(CONN_IS_EDGE(conn)); switch (conn->state) { case AP_CONN_STATE_SOCKS_WAIT: @@ -105,7 +105,7 @@ int connection_edge_process_inbuf(connection_t *conn, int package_partial) { * Mark it for close and return 0. */ int connection_edge_destroy(uint16_t circ_id, connection_t *conn) { - tor_assert(conn->type == CONN_TYPE_AP || conn->type == CONN_TYPE_EXIT); + tor_assert(CONN_IS_EDGE(conn)); if (conn->marked_for_close) return 0; /* already marked; probably got an 'end' */ @@ -173,7 +173,7 @@ connection_edge_end(connection_t *conn, char reason, crypt_path_t *cpath_layer) */ int connection_edge_finished_flushing(connection_t *conn) { tor_assert(conn); - tor_assert(conn->type == CONN_TYPE_AP || conn->type == CONN_TYPE_EXIT); + tor_assert(CONN_IS_EDGE(conn)); switch (conn->state) { case AP_CONN_STATE_OPEN: @@ -1148,8 +1148,8 @@ connection_exit_connect(connection_t *conn) { conn->state = EXIT_CONN_STATE_CONNECTING; connection_watch_events(conn, EV_WRITE | EV_READ); - /* writable indicates finish, readable indicates broken link, - error indicates broken link in windowsland. */ + /* writable indicates finish; + * readable/error indicates broken link in windowsland. */ return; /* case 1: fall through */ } |