summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-16 19:16:07 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-16 19:16:07 -0500
commite6be486aea1a102d73c4432340c533eea80740e1 (patch)
tree5fe3d21c6600efb9f1336e05c468d6c0e50c7a10 /src/or/connection_edge.c
parent24fcb6adbb3896395edda38d6ecccb6ad53bddbd (diff)
downloadtor-e6be486aea1a102d73c4432340c533eea80740e1.tar.gz
tor-e6be486aea1a102d73c4432340c533eea80740e1.zip
More emergency-check code for un-removed pending entry conns
This might also be what #17752 needs.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index d4ef064164..8a3beb3ce9 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -566,11 +566,9 @@ connection_ap_about_to_close(entry_connection_t *entry_conn)
#if 1
/* Check to make sure that this isn't in pending_entry_connections if it
* didn't actually belong there. */
- if (TO_CONN(edge_conn)->type == CONN_TYPE_AP &&
- smartlist_contains(pending_entry_connections, entry_conn)) {
- log_warn(LD_BUG, "What was %p doing in pending_entry_connections???",
- entry_conn);
- smartlist_remove(pending_entry_connections, entry_conn);
+ if (TO_CONN(edge_conn)->type == CONN_TYPE_AP) {
+ connection_ap_warn_and_unmark_if_pending_circ(entry_conn,
+ "about_to_close");
}
#endif
@@ -903,6 +901,19 @@ connection_ap_mark_as_non_pending_circuit(entry_connection_t *entry_conn)
smartlist_remove(pending_entry_connections, entry_conn);
}
+/** DOCDOC */
+void
+connection_ap_warn_and_unmark_if_pending_circ(entry_connection_t *entry_conn,
+ const char *where)
+{
+ if (pending_entry_connections &&
+ smartlist_contains(pending_entry_connections, entry_conn)) {
+ log_warn(LD_BUG, "What was %p doing in pending_entry_connections in %s?",
+ entry_conn, where);
+ connection_ap_mark_as_non_pending_circuit(entry_conn);
+ }
+}
+
/** Tell any AP streams that are waiting for a one-hop tunnel to
* <b>failed_digest</b> that they are going to fail. */
/* XXX024 We should get rid of this function, and instead attach