aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2013-01-18 19:37:16 -0800
committerMike Perry <mikeperry-git@fscked.org>2013-01-18 19:46:21 -0800
commite13e30221ef6715cafa93bbffc156583c8b58ecf (patch)
tree09b12822e6f3b3dafbe610a35617e8c8c2f4777c /src/or/connection_edge.c
parentee421e68d5231e3962b45f8bbfc6505c8e6f3315 (diff)
downloadtor-e13e30221ef6715cafa93bbffc156583c8b58ecf.tar.gz
tor-e13e30221ef6715cafa93bbffc156583c8b58ecf.zip
Implement Path use bias accounting.
Path use bias measures how often we can actually succeed using the circuits we actually try to use. It is a subset of path bias accounting, but it is computed as a separate statistic because the rate of client circuit use may vary depending on use case.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 870ded98c9..41795acb6c 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -37,6 +37,7 @@
#include "router.h"
#include "routerlist.h"
#include "routerset.h"
+#include "circuitbuild.h"
#ifdef HAVE_LINUX_TYPES_H
#include <linux/types.h>
@@ -2205,8 +2206,10 @@ connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply,
U64_PRINTF_ARG(ENTRY_TO_CONN(conn)->global_identifier),
endreason);
} else {
- TO_ORIGIN_CIRCUIT(conn->edge_.on_circuit)->path_state
- = PATH_STATE_USE_SUCCEEDED;
+ // XXX: Hrmm. It looks like optimistic data can't go through this
+ // codepath, but someone should probably test it and make sure.
+ // We don't want to mark optimistically opened streams as successful.
+ pathbias_mark_use_success(TO_ORIGIN_CIRCUIT(conn->edge_.on_circuit));
}
}
@@ -2480,7 +2483,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
connection_exit_connect(n_stream);
/* For path bias: This circuit was used successfully */
- origin_circ->path_state = PATH_STATE_USE_SUCCEEDED;
+ pathbias_mark_use_success(origin_circ);
tor_free(address);
return 0;