summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-28 12:35:50 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-28 12:35:50 -0400
commit3b960df4f9990355fc2514689280731c31551a4a (patch)
treea9b66d71b045612073c4bd53f836c6ff7776f480
parent103dd68ba8e1d0780dee1ef1c02ccd2ed6cc0542 (diff)
parent21a9d034455a9c302055524a9d4dccbfddb220f2 (diff)
downloadtor-3b960df4f9990355fc2514689280731c31551a4a.tar.gz
tor-3b960df4f9990355fc2514689280731c31551a4a.zip
Merge branch 'bug26896_034'
-rw-r--r--changes/bug268963
-rw-r--r--src/feature/dircache/directory.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/changes/bug26896 b/changes/bug26896
new file mode 100644
index 0000000000..9762dc7fac
--- /dev/null
+++ b/changes/bug26896
@@ -0,0 +1,3 @@
+ o Minor bugfixes (directory connection shutdown):
+ - Avoid a double-close when shutting down a stalled directory connection.
+ Fixes bug 26896; bugfix on 0.3.4.1-alpha.
diff --git a/src/feature/dircache/directory.c b/src/feature/dircache/directory.c
index a723176185..888a7c1939 100644
--- a/src/feature/dircache/directory.c
+++ b/src/feature/dircache/directory.c
@@ -5210,6 +5210,9 @@ connection_dir_finished_flushing(dir_connection_t *conn)
tor_assert(conn);
tor_assert(conn->base_.type == CONN_TYPE_DIR);
+ if (conn->base_.marked_for_close)
+ return 0;
+
/* Note that we have finished writing the directory response. For direct
* connections this means we're done; for tunneled connections it's only
* an intermediate step. */