diff options
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index dc75601ab..96f8d458a 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1393,9 +1393,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).", @@ -3434,6 +3431,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: |