diff options
author | Roger Dingledine <arma@torproject.org> | 2006-10-06 23:37:07 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-10-06 23:37:07 +0000 |
commit | 1cf37f90c4da02335109dad3cd4bb3fcdce81f24 (patch) | |
tree | 80e0a99b3e1b48d01ebce2ac02fe697b7a2eab83 /src/or/connection.c | |
parent | 864069f5c754f291c1c4ce63a7f9dc2bc31d4afe (diff) | |
download | tor-1cf37f90c4da02335109dad3cd4bb3fcdce81f24.tar.gz tor-1cf37f90c4da02335109dad3cd4bb3fcdce81f24.zip |
bugfix and cleanups re: entry guards.
svn:r8620
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 76e231398d..d60291253e 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -398,6 +398,7 @@ connection_about_to_close_connection(connection_t *conn) dir_connection_t *dir_conn; or_connection_t *or_conn; edge_connection_t *edge_conn; + time_t now = time(NULL); assert(conn->marked_for_close); @@ -427,8 +428,8 @@ connection_about_to_close_connection(connection_t *conn) /* Remember why we're closing this connection. */ if (conn->state != OR_CONN_STATE_OPEN) { if (connection_or_nonopen_was_started_here(or_conn)) { - rep_hist_note_connect_failed(or_conn->identity_digest, time(NULL)); - entry_guard_register_connect_status(or_conn->identity_digest, 0); + rep_hist_note_connect_failed(or_conn->identity_digest, now); + entry_guard_register_connect_status(or_conn->identity_digest,0,now); router_set_status(or_conn->identity_digest, 0); control_event_or_conn_status(or_conn, OR_CONN_EVENT_FAILED); } @@ -442,10 +443,10 @@ connection_about_to_close_connection(connection_t *conn) * flushing still get noted as dead, not disconnected. But this is an * improvement. -NM */ - rep_hist_note_disconnect(or_conn->identity_digest, time(NULL)); + rep_hist_note_disconnect(or_conn->identity_digest, now); control_event_or_conn_status(or_conn, OR_CONN_EVENT_CLOSED); } else if (or_conn->identity_digest) { - rep_hist_note_connection_died(or_conn->identity_digest, time(NULL)); + rep_hist_note_connection_died(or_conn->identity_digest, now); control_event_or_conn_status(or_conn, OR_CONN_EVENT_CLOSED); } break; |