diff options
author | Roger Dingledine <arma@torproject.org> | 2004-11-21 11:20:28 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-11-21 11:20:28 +0000 |
commit | 27b87972451325d76fbbcd6ac516427052b097ec (patch) | |
tree | 50dd89e7175ae5299ea761acb7d25e0bc3a51057 /src/or/relay.c | |
parent | 310a8da0d2ef457a245843268677f50c6ea84a98 (diff) | |
download | tor-27b87972451325d76fbbcd6ac516427052b097ec.tar.gz tor-27b87972451325d76fbbcd6ac516427052b097ec.zip |
clean up some more.
i think i'm getting closer.
svn:r2931
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 01d8edf84f..41c0bc77c9 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1009,7 +1009,7 @@ circuit_resume_edge_reading_helper(connection_t *conn, /** Check if the package window for <b>circ</b> is empty (at * hop <b>layer_hint</b> if it's defined). * - * If yes, tell edge streams to stop reading and return -1. + * If yes, tell edge streams to stop reading and return 1. * Else return 0. */ static int @@ -1017,13 +1017,19 @@ circuit_consider_stop_edge_reading(circuit_t *circ, crypt_path_t *layer_hint) { connection_t *conn = NULL; - log_fn(LOG_DEBUG,"considering"); - if(!layer_hint && circ->package_window <= 0) { - log_fn(LOG_DEBUG,"yes, not-at-origin. stopped."); - for(conn = circ->n_streams; conn; conn=conn->next_stream) - connection_stop_reading(conn); - return -1; - } else if(layer_hint && layer_hint->package_window <= 0) { + if (!layer_hint) { + log_fn(LOG_DEBUG,"considering circ->package_window %d", circ->package_window); + if (circ->package_window <= 0) { + log_fn(LOG_DEBUG,"yes, not-at-origin. stopped."); + for(conn = circ->n_streams; conn; conn=conn->next_stream) + connection_stop_reading(conn); + return 1; + } + return 0; + } + /* else, layer hint is defined, use it */ + log_fn(LOG_DEBUG,"considering layer_hint->package_window %d", layer_hint->package_window); + if (layer_hint->package_window <= 0) { log_fn(LOG_DEBUG,"yes, at-origin. stopped."); for(conn = circ->n_streams; conn; conn=conn->next_stream) if(conn->cpath_layer == layer_hint) @@ -1031,7 +1037,7 @@ circuit_consider_stop_edge_reading(circuit_t *circ, crypt_path_t *layer_hint) for(conn = circ->p_streams; conn; conn=conn->next_stream) if(conn->cpath_layer == layer_hint) connection_stop_reading(conn); - return -1; + return 1; } return 0; } |