summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-19 15:02:22 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-19 15:02:22 -0500
commit8ddf4e218e24167d1c595b74af62dd83b60d99a7 (patch)
tree05dbacfd35c4a79fef1d2f0ac0f4da52df1bac81
parent804be10b096de6e6a7204cf3268857d3b59ef51e (diff)
parent3340d3279de0bb411c506a759778ee7a9b45165b (diff)
downloadtor-8ddf4e218e24167d1c595b74af62dd83b60d99a7.tar.gz
tor-8ddf4e218e24167d1c595b74af62dd83b60d99a7.zip
Merge branch 'bug8065_v2'
-rw-r--r--changes/bug80656
-rw-r--r--src/or/circuitbuild.c2
-rw-r--r--src/or/circuitbuild.h1
-rw-r--r--src/or/connection_edge.c11
4 files changed, 18 insertions, 2 deletions
diff --git a/changes/bug8065 b/changes/bug8065
new file mode 100644
index 0000000000..06dbae8cd7
--- /dev/null
+++ b/changes/bug8065
@@ -0,0 +1,6 @@
+ o Minor bugfixes:
+ - Downgrade an assertion in connection_ap_expire_beginning to
+ an LD_BUG message. The fix for bug 8024 should prevent this
+ message from displaying, but just in case a warn that we can
+ diagnose is better than more assert crashes. Fix for bug 8065;
+ bugfix on 0.2.4.8-alpha.
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 40751e02b1..8a3a36accb 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1269,7 +1269,7 @@ pathbias_get_scale_use_threshold(const or_options_t *options)
/**
* Convert a Guard's path state to string.
*/
-static const char *
+const char *
pathbias_state_to_string(path_state_t state)
{
switch (state) {
diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h
index 3ca8d1531d..a3091707e8 100644
--- a/src/or/circuitbuild.h
+++ b/src/or/circuitbuild.h
@@ -66,6 +66,7 @@ int pathbias_check_probe_response(circuit_t *circ, const cell_t *cell);
void pathbias_count_use_attempt(origin_circuit_t *circ);
void pathbias_mark_use_success(origin_circuit_t *circ);
void pathbias_mark_use_rollback(origin_circuit_t *circ);
+const char *pathbias_state_to_string(path_state_t state);
#endif
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index b4fa3e6fe2..abde2e19f2 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -651,7 +651,16 @@ connection_ap_expire_beginning(void)
}
continue;
}
- tor_assert(circ->purpose == CIRCUIT_PURPOSE_C_GENERAL);
+ if (circ->purpose != CIRCUIT_PURPOSE_C_GENERAL) {
+ log_warn(LD_BUG, "circuit->purpose == CIRCUIT_PURPOSE_C_GENERAL failed. "
+ "The purpose on the circuit was %s; it was in state %s, "
+ "path_state %s.",
+ circuit_purpose_to_string(circ->purpose),
+ circuit_state_to_string(circ->state),
+ CIRCUIT_IS_ORIGIN(circ) ?
+ pathbias_state_to_string(TO_ORIGIN_CIRCUIT(circ)->path_state) :
+ "none");
+ }
log_fn(cutoff < 15 ? LOG_INFO : severity, LD_APP,
"We tried for %d seconds to connect to '%s' using exit %s."
" Retrying on a new circuit.",