diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-12-17 22:44:11 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-12-17 22:44:11 +0000 |
commit | 820159cac540b4777fb639de663d72f04690e2a2 (patch) | |
tree | 19c9e2111094adf957641203ffb9e95b260e997a /src/or/connection_or.c | |
parent | 7412008d1457300535c751060991e7ea8ffa2279 (diff) | |
download | tor-820159cac540b4777fb639de663d72f04690e2a2.tar.gz tor-820159cac540b4777fb639de663d72f04690e2a2.zip |
r15530@tombo: nickm | 2007-12-17 16:54:03 -0500
First wodge of geoip code so bridges can figure out which countries are blocking them.
svn:r12845
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index c4f61577d5..dd49af93c1 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -893,17 +893,20 @@ int connection_or_set_state_open(or_connection_t *conn) { int started_here = connection_or_nonopen_was_started_here(conn); + time_t now = time(NULL); conn->_base.state = OR_CONN_STATE_OPEN; control_event_or_conn_status(conn, OR_CONN_EVENT_CONNECTED, 0); if (started_here) { - rep_hist_note_connect_succeeded(conn->identity_digest, time(NULL)); - if (entry_guard_register_connect_status(conn->identity_digest, 1, - time(NULL)) < 0) { + rep_hist_note_connect_succeeded(conn->identity_digest, now); + if (entry_guard_register_connect_status(conn->identity_digest, + 1, now) < 0) { /* pending circs get closed in circuit_about_to_close_connection() */ return -1; } router_set_status(conn->identity_digest, 1); + } else { + geoip_note_client_seen(TO_CONN(conn)->addr, now); } if (conn->handshake_state) { or_handshake_state_free(conn->handshake_state); |