mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Move pending-connection code into connection_ap_about_to_close
It is AP-specific, so that's where it belongs. This shouldn't have caused a bug, but due to #17876, we were never actually calling connection_edge_about_to_close from connection_ap_about_to_close, causing bug #17874 (aka bug #17752).
This commit is contained in:
parent
3317cd3a1f
commit
613e0e1c1a
@ -527,27 +527,6 @@ connection_edge_about_to_close(edge_connection_t *edge_conn)
|
||||
conn->marked_for_close_file, conn->marked_for_close);
|
||||
tor_fragile_assert();
|
||||
}
|
||||
|
||||
if (TO_CONN(edge_conn)->type != CONN_TYPE_AP ||
|
||||
PREDICT_UNLIKELY(NULL == pending_entry_connections))
|
||||
return;
|
||||
|
||||
entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(edge_conn);
|
||||
|
||||
if (TO_CONN(edge_conn)->state == AP_CONN_STATE_CIRCUIT_WAIT) {
|
||||
smartlist_remove(pending_entry_connections, 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);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Called when we're about to finally unlink and free an AP (client)
|
||||
@ -577,6 +556,22 @@ connection_ap_about_to_close(entry_connection_t *entry_conn)
|
||||
conn->marked_for_close_file, conn->marked_for_close);
|
||||
dnsserv_reject_request(entry_conn);
|
||||
}
|
||||
|
||||
if (TO_CONN(edge_conn)->state == AP_CONN_STATE_CIRCUIT_WAIT) {
|
||||
smartlist_remove(pending_entry_connections, 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);
|
||||
}
|
||||
#endif
|
||||
|
||||
control_event_stream_bandwidth(edge_conn);
|
||||
control_event_stream_status(entry_conn, STREAM_EVENT_CLOSED,
|
||||
edge_conn->end_reason);
|
||||
|
Loading…
Reference in New Issue
Block a user