aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-10-13 13:17:27 +0000
committerRoger Dingledine <arma@torproject.org>2002-10-13 13:17:27 +0000
commit84a34edfa1490a1503b8d7fc9e0a95f9bcd2a175 (patch)
tree859c62b1cbafbc692114a78560032d6baa860f2e /src/or/connection.c
parent74787aa2d4845501b5ccd72dec46eaaa4c45a664 (diff)
downloadtor-84a34edfa1490a1503b8d7fc9e0a95f9bcd2a175.tar
tor-84a34edfa1490a1503b8d7fc9e0a95f9bcd2a175.tar.gz
expire unfinished handshakes too
don't list non-open ORs in the directory svn:r134
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 1a8ab8ae4..6784580cb 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -103,8 +103,11 @@ connection_t *connection_new(int type) {
conn->receiver_bucket = 10240; /* should be enough to do the handshake */
conn->bandwidth = conn->receiver_bucket / 10; /* give it a default */
+
conn->timestamp_created = now.tv_sec;
-
+ conn->timestamp_lastread = now.tv_sec;
+ conn->timestamp_lastwritten = now.tv_sec;
+
if (connection_speaks_cells(conn)) {
conn->f_crypto = crypto_new_cipher_env(CRYPTO_CIPHER_DES);
if (!conn->f_crypto) {
@@ -224,6 +227,8 @@ int connection_handle_listener_read(connection_t *conn, int new_type, int new_st
}
newconn->address = strdup(inet_ntoa(remote.sin_addr)); /* remember the remote address */
+ newconn->addr = ntohl(remote.sin_addr.s_addr);
+ newconn->port = ntohs(remote.sin_port);
if(connection_add(newconn) < 0) { /* no space, forget it */
connection_free(newconn);