diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-03-13 15:38:20 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-03-28 19:55:03 +0200 |
commit | 8aa69a1b69b64185333fb1b6e74d55fc5e341fd8 (patch) | |
tree | 376215dbef2ca72b2638956fabd14f6294c33bbc /src/or/connection.c | |
parent | 8587f663ee5f8f4af4fbbd5542116eb22ed1814e (diff) | |
download | tor-8aa69a1b69b64185333fb1b6e74d55fc5e341fd8.tar.gz tor-8aa69a1b69b64185333fb1b6e74d55fc5e341fd8.zip |
Refactor the directory spool implementation
The old implementation had duplicated code in a bunch of places, and
it interspersed spool-management with resource management. The new
implementation should make it easier to add new resource types and
maintain the spooling code.
Closing ticket 21651.
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 188276026f..3c51df3df8 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -629,12 +629,12 @@ connection_free_(connection_t *conn) tor_free(dir_conn->requested_resource); tor_zlib_free(dir_conn->zlib_state); - if (dir_conn->fingerprint_stack) { - SMARTLIST_FOREACH(dir_conn->fingerprint_stack, char *, cp, tor_free(cp)); - smartlist_free(dir_conn->fingerprint_stack); + if (dir_conn->spool) { + SMARTLIST_FOREACH(dir_conn->spool, spooled_resource_t *, spooled, + spooled_resource_free(spooled)); + smartlist_free(dir_conn->spool); } - cached_dir_decref(dir_conn->cached_dir); rend_data_free(dir_conn->rend_data); if (dir_conn->guard_state) { /* Cancel before freeing, if it's still there. */ |