diff options
author | David Goulet <dgoulet@torproject.org> | 2017-08-30 09:15:54 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-30 09:15:54 -0400 |
commit | 22295759afa90f19b06e2b657ce84d518c2390fd (patch) | |
tree | 87ab2f6eeca8091e4c775c031910863b918077b3 /src/or/connection.c | |
parent | 209bfe715cc8c1c59b2578c406749a0d4a5bd8cb (diff) | |
download | tor-22295759afa90f19b06e2b657ce84d518c2390fd.tar.gz tor-22295759afa90f19b06e2b657ce84d518c2390fd.zip |
prop224: Purge client state on NEWNYM
Closes #23355
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 31a682387d..01d7752e8d 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -4113,16 +4113,27 @@ connection_write_to_buf_impl_,(const char *string, size_t len, return ret_conns; \ STMT_END -/* Return a list of connections that aren't close and matches the given state. - * The returned list can be empty and must be freed using smartlist_free(). - * The caller does NOT have owernship of the objects in the list so it must - * not free them nor reference them as they can disapear. */ +/* Return a list of connections that aren't close and matches the given type + * and state. The returned list can be empty and must be freed using + * smartlist_free(). The caller does NOT have owernship of the objects in the + * list so it must not free them nor reference them as they can disappear. */ smartlist_t * connection_list_by_type_state(int type, int state) { CONN_GET_ALL_TEMPLATE(conn, (conn->type == type && conn->state == state)); } +/* Return a list of connections that aren't close and matches the given type + * and purpose. The returned list can be empty and must be freed using + * smartlist_free(). The caller does NOT have owernship of the objects in the + * list so it must not free them nor reference them as they can disappear. */ +smartlist_t * +connection_list_by_type_purpose(int type, int purpose) +{ + CONN_GET_ALL_TEMPLATE(conn, + (conn->type == type && conn->purpose == purpose)); +} + /** Return a connection_t * from get_connection_array() that satisfies test on * var, and that is not marked for close. */ #define CONN_GET_TEMPLATE(var, test) \ |