mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Fix Tor for no-threading compilation: move connection_unregister from _connection_free to connection_free.
svn:r4013
This commit is contained in:
parent
374edd356e
commit
ac268a8340
@ -171,8 +171,6 @@ _connection_free(connection_t *conn) {
|
|||||||
tor_free(conn->chosen_exit_name);
|
tor_free(conn->chosen_exit_name);
|
||||||
|
|
||||||
if (connection_speaks_cells(conn)) {
|
if (connection_speaks_cells(conn)) {
|
||||||
if (conn->state == OR_CONN_STATE_OPEN)
|
|
||||||
directory_set_dirty();
|
|
||||||
if (conn->tls) {
|
if (conn->tls) {
|
||||||
tor_tls_free(conn->tls);
|
tor_tls_free(conn->tls);
|
||||||
conn->tls = NULL;
|
conn->tls = NULL;
|
||||||
@ -183,8 +181,8 @@ _connection_free(connection_t *conn) {
|
|||||||
crypto_free_pk_env(conn->identity_pkey);
|
crypto_free_pk_env(conn->identity_pkey);
|
||||||
tor_free(conn->nickname);
|
tor_free(conn->nickname);
|
||||||
tor_free(conn->socks_request);
|
tor_free(conn->socks_request);
|
||||||
|
tor_free(conn->read_event); /* Probably already freed by connection_free. */
|
||||||
connection_unregister(conn);
|
tor_free(conn->write_event); /* Probably already freed by connection_free. */
|
||||||
|
|
||||||
if (conn->s >= 0) {
|
if (conn->s >= 0) {
|
||||||
log_fn(LOG_INFO,"closing fd %d.",conn->s);
|
log_fn(LOG_INFO,"closing fd %d.",conn->s);
|
||||||
@ -201,6 +199,11 @@ void connection_free(connection_t *conn) {
|
|||||||
tor_assert(conn);
|
tor_assert(conn);
|
||||||
tor_assert(!connection_is_on_closeable_list(conn));
|
tor_assert(!connection_is_on_closeable_list(conn));
|
||||||
tor_assert(!connection_in_array(conn));
|
tor_assert(!connection_in_array(conn));
|
||||||
|
if (connection_speaks_cells(conn)) {
|
||||||
|
if (conn->state == OR_CONN_STATE_OPEN)
|
||||||
|
directory_set_dirty();
|
||||||
|
}
|
||||||
|
connection_unregister(conn);
|
||||||
_connection_free(conn);
|
_connection_free(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user