summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-07-12 16:33:31 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2009-07-15 16:12:45 +0200
commit3c051325758c0aeeeb44054715e16d8b8717948c (patch)
treea9e595b28ce218f3998ed0d3a10f54fc55eefd4e /src/or/connection_edge.c
parent72c5a46b43c6d89c773a99240a95301b91b1f269 (diff)
downloadtor-3c051325758c0aeeeb44054715e16d8b8717948c.tar.gz
tor-3c051325758c0aeeeb44054715e16d8b8717948c.zip
Directories now also measure download times of network statuses.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 560a2433d7..f32563bcdb 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2551,6 +2551,11 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
log_debug(LD_EXIT,"Creating new exit connection.");
n_stream = edge_connection_new(CONN_TYPE_EXIT, AF_INET);
+#ifdef ENABLE_GEOIP_STATS
+ /* Remember the tunneled request ID in the new edge connection, so that
+ * we can measure download times. */
+ TO_CONN(n_stream)->request_id = circ->request_id;
+#endif
n_stream->_base.purpose = EXIT_PURPOSE_CONNECT;
n_stream->stream_id = rh.stream_id;
@@ -2787,6 +2792,11 @@ connection_exit_connect_dir(edge_connection_t *exitconn)
dirconn->_base.purpose = DIR_PURPOSE_SERVER;
dirconn->_base.state = DIR_CONN_STATE_SERVER_COMMAND_WAIT;
+#ifdef ENABLE_GEOIP_STATS
+ /* Note that the new dir conn belongs to the same tunneled request as
+ * the edge conn, so that we can measure download times. */
+ TO_CONN(dirconn)->request_id = TO_CONN(exitconn)->request_id;
+#endif
connection_link_connections(TO_CONN(dirconn), TO_CONN(exitconn));
if (connection_add(TO_CONN(exitconn))<0) {