aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-11-08 16:19:07 +0000
committerNick Mathewson <nickm@torproject.org>2007-11-08 16:19:07 +0000
commitc3a745951b881c159289a964370c6e7b2f31671c (patch)
tree5adf84e08baba139e908b9854337d627099b0b69 /src/or/connection_or.c
parent17a34e4a43e6d9c3d95b48dbd7675b4a3bfc90ac (diff)
downloadtor-c3a745951b881c159289a964370c6e7b2f31671c.tar.gz
tor-c3a745951b881c159289a964370c6e7b2f31671c.zip
r16570@catbus: nickm | 2007-11-08 11:04:20 -0500
Keep track, for each OR connection, of the last time we added a non-padding cell to its outbuf. Use this timestamp, not "lastwritten" to tell if it is time to close a circuitless connection. (We can'tuse lastwritten, since lastwritten is updated when ever the connection flushes anything, and by that point we can no longer tell what is a padding cell and what is not.) svn:r12437
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 6e649bee2e..fb29fa5870 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -855,6 +855,9 @@ connection_or_write_cell_to_buf(const cell_t *cell, or_connection_t *conn)
cell_pack(&networkcell, cell);
connection_write_to_buf(networkcell.body, CELL_NETWORK_SIZE, TO_CONN(conn));
+
+ if (cell->command != CELL_PADDING)
+ conn->timestamp_last_added_nonpadding = time(NULL);
}
/**DOCDOC*/
@@ -868,6 +871,8 @@ connection_or_write_var_cell_to_buf(const var_cell_t *cell,
var_cell_pack_header(cell, hdr);
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);
}
/** DOCDOC */