diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-11-08 16:19:07 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-11-08 16:19:07 +0000 |
commit | c3a745951b881c159289a964370c6e7b2f31671c (patch) | |
tree | 5adf84e08baba139e908b9854337d627099b0b69 /src/or/connection.c | |
parent | 17a34e4a43e6d9c3d95b48dbd7675b4a3bfc90ac (diff) | |
download | tor-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.c')
-rw-r--r-- | src/or/connection.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 0dd2f9e43d..24fd567de0 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -209,8 +209,10 @@ connection_new(int type, int socket_family) if (CONN_IS_EDGE(conn)) { TO_EDGE_CONN(conn)->global_identifier = n_connections_allocated++; } - if (type == CONN_TYPE_OR) + if (type == CONN_TYPE_OR) { + TO_OR_CONN(conn)->timestamp_last_added_nonpadding = now; TO_OR_CONN(conn)->next_circ_id = crypto_rand_int(1<<15); + } conn->timestamp_created = now; conn->timestamp_lastread = now; |