summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-31 15:07:19 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-31 15:07:19 -0400
commitfc0842275de8f8ab43374df922907d97b4e60b58 (patch)
tree27063cf95afbed2ca5c7ccde1f3504807de7d3a5
parentd1bbd84a6d1f5e721badb55755e278f2e4f0bf7b (diff)
parent9d41629aa072b389332273a21926260c302b49e1 (diff)
downloadtor-fc0842275de8f8ab43374df922907d97b4e60b58.tar.gz
tor-fc0842275de8f8ab43374df922907d97b4e60b58.zip
Merge remote-tracking branch 'public/bug5374'
-rw-r--r--changes/bug53747
-rw-r--r--src/or/connection.c11
2 files changed, 15 insertions, 3 deletions
diff --git a/changes/bug5374 b/changes/bug5374
new file mode 100644
index 0000000000..926a074903
--- /dev/null
+++ b/changes/bug5374
@@ -0,0 +1,7 @@
+ o Minor bugfixes:
+
+ - Don't check for whether the address we're using for outbound
+ connections has changed until after the outbound connection has
+ completed. On Windows, getsockname() doesn't succeed until the
+ connection is finished. Fix for bug 5374; bugfix on
+ 0.1.1.14-alpha.
diff --git a/src/or/connection.c b/src/or/connection.c
index eb8b840eb7..beeeb2aab0 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1416,9 +1416,6 @@ connection_connect(connection_t *conn, const char *address,
}
}
- if (!server_mode(options))
- client_check_address_changed(s);
-
/* it succeeded. we're connected. */
log_fn(inprogress?LOG_DEBUG:LOG_INFO, LD_NET,
"Connection to %s:%u %s (sock %d).",
@@ -3898,6 +3895,14 @@ static int
connection_finished_connecting(connection_t *conn)
{
tor_assert(conn);
+
+ if (!server_mode(get_options())) {
+ /* See whether getsockname() says our address changed. We need to do this
+ * now that the connection has finished, because getsockname() on Windows
+ * won't work until then. */
+ client_check_address_changed(conn->s);
+ }
+
switch (conn->type)
{
case CONN_TYPE_OR: