From: Nick Mathewson Date: Tue, 17 Nov 2015 14:40:05 +0000 (-0500) Subject: Don't relaunch dir requests recursively if connection_connect() returns -1 X-Git-Tag: tor-0.2.8.1-alpha~217^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc0d2b59706d036b97451dc1f8addc86ed783c2e;p=thirdparty%2Ftor.git Don't relaunch dir requests recursively if connection_connect() returns -1 Closes ticket 17589. --- diff --git a/changes/bug17589 b/changes/bug17589 new file mode 100644 index 0000000000..91103276df --- /dev/null +++ b/changes/bug17589 @@ -0,0 +1,7 @@ + o Code simplificiation and refactoring: + - When a direct directory request fails immediately on launch, + instead of relaunching that request from inside the code that + launches it, instead mark the connection for teardown. This + change simplifies Tor's callback and prevents the directory- + request launching code from invoking itself recursively. + Closes ticket 17589. \ No newline at end of file diff --git a/src/or/directory.c b/src/or/directory.c index 6f8edb5ad4..8d4c0a86d0 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -991,10 +991,7 @@ directory_initiate_command_rend(const tor_addr_t *_addr, switch (connection_connect(TO_CONN(conn), conn->base_.address, &addr, dir_port, &socket_error)) { case -1: - connection_dir_request_failed(conn); /* retry if we want */ - /* XXX we only pass 'conn' above, not 'resource', 'payload', - * etc. So in many situations it can't retry! -RD */ - connection_free(TO_CONN(conn)); + connection_mark_for_close(TO_CONN(conn)); return; case 1: /* start flushing conn */