diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-19 18:51:35 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-19 18:51:35 +0000 |
commit | 8c90a4b7ee4d65ae561e03b0fc8a000d0f5d3c2f (patch) | |
tree | a1ab1b4c1748ac9f2573f1d37acdea4c65c01b23 /src/or/connection_or.c | |
parent | 60d61759061e28ed652be6b9562892e0d31c6553 (diff) | |
download | tor-8c90a4b7ee4d65ae561e03b0fc8a000d0f5d3c2f.tar.gz tor-8c90a4b7ee4d65ae561e03b0fc8a000d0f5d3c2f.zip |
More approx_time() calls. Noted by forest.
svn:r17702
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 399ba1801c..93bd42485f 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -285,12 +285,12 @@ int connection_or_flushed_some(or_connection_t *conn) { size_t datalen = buf_datalen(conn->_base.outbuf); - time_t now = time(NULL); /* If we're under the low water mark, add cells until we're just over the * high water mark. */ if (datalen < OR_CONN_LOWWATER) { ssize_t n = (OR_CONN_HIGHWATER - datalen + CELL_NETWORK_SIZE-1) / CELL_NETWORK_SIZE; + time_t now = approx_time(); while (conn->active_circuits && n > 0) { int flushed; flushed = connection_or_flush_from_first_active_circuit(conn, 1, now); @@ -962,7 +962,7 @@ connection_or_write_cell_to_buf(const cell_t *cell, or_connection_t *conn) connection_write_to_buf(networkcell.body, CELL_NETWORK_SIZE, TO_CONN(conn)); if (cell->command != CELL_PADDING) - conn->timestamp_last_added_nonpadding = time(NULL); + conn->timestamp_last_added_nonpadding = approx_time(); } /** Pack a variable-length <b>cell</b> into wire-format, and write it onto @@ -980,7 +980,7 @@ connection_or_write_var_cell_to_buf(const var_cell_t *cell, connection_write_to_buf(hdr, sizeof(hdr), TO_CONN(conn)); connection_write_to_buf(cell->payload, cell->payload_len, TO_CONN(conn)); if (cell->command != CELL_PADDING) - conn->timestamp_last_added_nonpadding = time(NULL); + conn->timestamp_last_added_nonpadding = approx_time(); } /** See whether there's a variable-length cell waiting on <b>conn</b>'s |