diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-03-14 18:08:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-03-14 18:24:47 -0400 |
commit | fe9de9231acdd50dcaac5c7908ea9d29f2b21b48 (patch) | |
tree | ad1ed0cccc02bdd6327c7e01fce4ddbb290a1a70 /src/or/relay.c | |
parent | bd7721f66ef94d2f3502197bf23a4cf67813eb9f (diff) | |
download | tor-fe9de9231acdd50dcaac5c7908ea9d29f2b21b48.tar.gz tor-fe9de9231acdd50dcaac5c7908ea9d29f2b21b48.zip |
Revise prop174 patch: make the circuit sendme calls unconditional.
The circuit_consider_sending_sendme call should be unconditional,
since the circuit windows can move independent of the state of streams.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 19f8d41562..17ce7db4f8 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1116,9 +1116,7 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, log_debug(domain,"circ deliver_window now %d.", layer_hint ? layer_hint->deliver_window : circ->deliver_window); - if (!optimistic_data) { - circuit_consider_sending_sendme(circ, layer_hint); - } + circuit_consider_sending_sendme(circ, layer_hint); if (!conn) { log_info(domain,"data cell dropped, unknown stream (streamid %d).", @@ -1135,9 +1133,14 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, stats_n_data_bytes_received += rh.length; connection_write_to_buf((char*)(cell->payload + RELAY_HEADER_SIZE), rh.length, TO_CONN(conn)); + if (!optimistic_data) { - connection_edge_consider_sending_sendme(conn); + /* Only send a SENDME if we're not getting optimistic data; otherwise + * a SENDME could arrive before the CONNECTED. + */ + connection_edge_consider_sending_sendme(conn); } + return 0; case RELAY_COMMAND_END: reason = rh.length > 0 ? |