Rename connection_or_remove_from_identity_map

This commit is contained in:
Nick Mathewson 2016-09-19 16:26:27 -04:00
parent cdce221e68
commit 6aa239df36
5 changed files with 9 additions and 9 deletions

View File

@ -644,7 +644,7 @@ connection_free_(connection_t *conn)
if (conn->type == CONN_TYPE_OR &&
!tor_digest_is_zero(TO_OR_CONN(conn)->identity_digest)) {
log_warn(LD_BUG, "called on OR conn with non-zeroed identity_digest");
connection_or_remove_from_identity_map(TO_OR_CONN(conn));
connection_or_clear_identity(TO_OR_CONN(conn));
}
if (conn->type == CONN_TYPE_OR || conn->type == CONN_TYPE_EXT_OR) {
connection_or_remove_from_ext_or_id_map(TO_OR_CONN(conn));
@ -675,7 +675,7 @@ connection_free,(connection_t *conn))
}
if (connection_speaks_cells(conn)) {
if (!tor_digest_is_zero(TO_OR_CONN(conn)->identity_digest)) {
connection_or_remove_from_identity_map(TO_OR_CONN(conn));
connection_or_clear_identity(TO_OR_CONN(conn));
}
}
if (conn->type == CONN_TYPE_CONTROL) {

View File

@ -84,7 +84,7 @@ static digestmap_t *orconn_ext_or_id_map = NULL;
/** Clear clear conn->identity_digest and update other data
* structures as appropriate.*/
void
connection_or_remove_from_identity_map(or_connection_t *conn)
connection_or_clear_identity(or_connection_t *conn)
{
tor_assert(conn);
memset(conn->identity_digest, 0, DIGEST_LEN);
@ -120,7 +120,7 @@ connection_or_set_identity_digest(or_connection_t *conn,
/* If the identity was set previously, remove the old mapping. */
if (! tor_digest_is_zero(conn->identity_digest)) {
connection_or_remove_from_identity_map(conn);
connection_or_clear_identity(conn);
if (conn->chan)
channel_clear_identity_digest(TLS_CHAN_TO_BASE(conn->chan));
}

View File

@ -12,7 +12,7 @@
#ifndef TOR_CONNECTION_OR_H
#define TOR_CONNECTION_OR_H
void connection_or_remove_from_identity_map(or_connection_t *conn);
void connection_or_clear_identity(or_connection_t *conn);
void connection_or_clear_identity_map(void);
void clear_broken_connection_map(int disable);
or_connection_t *connection_or_get_for_extend(const char *digest,

View File

@ -362,7 +362,7 @@ connection_unlink(connection_t *conn)
}
if (conn->type == CONN_TYPE_OR) {
if (!tor_digest_is_zero(TO_OR_CONN(conn)->identity_digest))
connection_or_remove_from_identity_map(TO_OR_CONN(conn));
connection_or_clear_identity(TO_OR_CONN(conn));
/* connection_unlink() can only get called if the connection
* was already on the closeable list, and it got there by
* connection_mark_for_close(), which was called from

View File

@ -323,7 +323,7 @@ recv_certs_cleanup(const struct testcase_t *test, void *obj)
if (d) {
tor_free(d->cell);
certs_cell_free(d->ccell);
connection_or_remove_from_identity_map(d->c);
connection_or_clear_identity(d->c);
connection_free_(TO_CONN(d->c));
circuitmux_free(d->chan->base_.cmux);
tor_free(d->chan);
@ -1133,8 +1133,8 @@ authenticate_data_cleanup(const struct testcase_t *test, void *arg)
authenticate_data_t *d = arg;
if (d) {
tor_free(d->cell);
connection_or_remove_from_identity_map(d->c1);
connection_or_remove_from_identity_map(d->c2);
connection_or_clear_identity(d->c1);
connection_or_clear_identity(d->c2);
connection_free_(TO_CONN(d->c1));
connection_free_(TO_CONN(d->c2));
circuitmux_free(d->chan2->base_.cmux);