diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-03-15 17:18:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-03-15 17:18:29 -0400 |
commit | 737228ed8e81de6619a29bd039d08d959d4164da (patch) | |
tree | ce95515af13ca4e6aa596c01b3575b895d14fb06 /src | |
parent | 4dde69a6d003682217c2bf6327b5923c7b811974 (diff) | |
parent | c5ffd44ccd3c60780143eb384938276522a173c1 (diff) | |
download | tor-737228ed8e81de6619a29bd039d08d959d4164da.tar tor-737228ed8e81de6619a29bd039d08d959d4164da.tar.gz |
Merge remote branch 'origin/maint-0.2.2'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection.c | 2 | ||||
-rw-r--r-- | src/or/connection_edge.c | 17 | ||||
-rw-r--r-- | src/or/connection_edge.h | 1 | ||||
-rw-r--r-- | src/or/relay.c | 5 |
4 files changed, 23 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 42f81d107..1603833a9 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -3648,6 +3648,8 @@ connection_flushed_some(connection_t *conn) r = connection_dirserv_flushed_some(TO_DIR_CONN(conn)); } else if (conn->type == CONN_TYPE_OR) { r = connection_or_flushed_some(TO_OR_CONN(conn)); + } else if (CONN_IS_EDGE(conn)) { + r = connection_edge_flushed_some(TO_EDGE_CONN(conn)); } conn->in_flushed_some = 0; return r; diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index bb36f0832..dc2598945 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -301,6 +301,23 @@ connection_edge_end_errno(edge_connection_t *conn) return connection_edge_end(conn, reason); } +/** We just wrote some data to <b>conn</b>; act appropriately. + * + * (That is, if it's open, consider sending a stream-level sendme cell if we + * have just flushed enough.) + */ +int +connection_edge_flushed_some(edge_connection_t *conn) +{ + switch (conn->_base.state) { + case AP_CONN_STATE_OPEN: + case EXIT_CONN_STATE_OPEN: + connection_edge_consider_sending_sendme(conn); + break; + } + return 0; +} + /** Connection <b>conn</b> has finished writing and has no bytes left on * its outbuf. * diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h index ec7c7f554..62a79db9e 100644 --- a/src/or/connection_edge.h +++ b/src/or/connection_edge.h @@ -23,6 +23,7 @@ int connection_edge_process_inbuf(edge_connection_t *conn, int connection_edge_destroy(circid_t circ_id, edge_connection_t *conn); int connection_edge_end(edge_connection_t *conn, uint8_t reason); int connection_edge_end_errno(edge_connection_t *conn); +int connection_edge_flushed_some(edge_connection_t *conn); int connection_edge_finished_flushing(edge_connection_t *conn); int connection_edge_finished_connecting(edge_connection_t *conn); diff --git a/src/or/relay.c b/src/or/relay.c index ec8e9ac8d..96430dcec 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1403,8 +1403,9 @@ connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial, goto repeat_connection_edge_package_raw_inbuf; } -/** Called when we've just received a relay data cell, or when - * we've just finished flushing all bytes to stream <b>conn</b>. +/** Called when we've just received a relay data cell, when + * we've just finished flushing all bytes to stream <b>conn</b>, + * or when we've flushed *some* bytes to the stream <b>conn</b>. * * If conn->outbuf is not too full, and our deliver window is * low, send back a suitable number of stream-level sendme cells. |