aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2012-11-17 17:51:27 -0800
committerMike Perry <mikeperry-git@fscked.org>2012-12-07 15:28:38 -0800
commitaa0e6e2c0337c5ddfc9f64ed593d8a59b3c4cb44 (patch)
treed53603ce35e8c65a151306cb4991e74b2a2a7225 /src
parent412ae099cb656ab47fc8cbb408aa5f4cee956961 (diff)
downloadtor-aa0e6e2c0337c5ddfc9f64ed593d8a59b3c4cb44.tar
tor-aa0e6e2c0337c5ddfc9f64ed593d8a59b3c4cb44.tar.gz
Prop 209: Add in hidserv path bias counts for usage.
Diffstat (limited to 'src')
-rw-r--r--src/or/connection_edge.c4
-rw-r--r--src/or/or.h5
-rw-r--r--src/or/rendclient.c3
-rw-r--r--src/or/rendservice.c3
4 files changed, 12 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index cb2afe1e8..a654b6171 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2454,6 +2454,10 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
assert_circuit_ok(circ);
connection_exit_connect(n_stream);
+
+ /* For path bias: This circuit was used successfully */
+ origin_circ->any_streams_succeeded = 1;
+
tor_free(address);
return 0;
}
diff --git a/src/or/or.h b/src/or/or.h
index f26fc394f..8501235b7 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2873,9 +2873,8 @@ typedef struct origin_circuit_t {
unsigned int isolation_any_streams_attached : 1;
/**
- * Did any SOCKS streams actually succeed on this circuit?
- *
- * XXX: We probably also need to set this for intro other hidserv circs..
+ * Did any SOCKS streams or hidserv introductions actually succeed on
+ * this circuit?
*/
unsigned int any_streams_succeeded : 1;
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 3fb4025e6..ec43041b1 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -378,6 +378,9 @@ rend_client_introduction_acked(origin_circuit_t *circ,
* it to specify when a circuit entered the
* _C_REND_READY_INTRO_ACKED state. */
rendcirc->base_.timestamp_dirty = time(NULL);
+
+ /* For path bias: This circuit was used successfully */
+ circ->any_streams_succeeded = 1;
} else {
log_info(LD_REND,"...Found no rend circ. Dropping on the floor.");
}
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 09792bd1d..775edd604 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1383,6 +1383,9 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (circuit_init_cpath_crypto(cpath,keys+DIGEST_LEN,1)<0)
goto err;
memcpy(cpath->handshake_digest, keys, DIGEST_LEN);
+
+ /* For path bias: This circuit was used successfully */
+ circuit->any_streams_succeeded = 1;
goto done;