diff options
author | Roger Dingledine <arma@torproject.org> | 2006-09-09 19:36:51 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-09-09 19:36:51 +0000 |
commit | e56dbb810f936d9737b7a3b48906dc9a8d333007 (patch) | |
tree | 9b4466d7bd3b19bc5f158785203ad0850c363491 /src/or/directory.c | |
parent | 9af3175687686841f25cab2fe7e1ade0c66a1ff9 (diff) | |
download | tor-e56dbb810f936d9737b7a3b48906dc9a8d333007.tar tor-e56dbb810f936d9737b7a3b48906dc9a8d333007.tar.gz |
start remembering X-Your-Address-Is hints even if you're
a client, so you can become a server more smoothly.
svn:r8359
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 2dbcb33c4..dfbd075e6 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -822,6 +822,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn) int skewed=0; int allow_partial = conn->_base.purpose == DIR_PURPOSE_FETCH_SERVERDESC; int was_compressed=0; + char *guess; switch (fetch_from_buf_http(conn->_base.inbuf, &headers, MAX_HEADERS_SIZE, @@ -855,12 +856,10 @@ connection_dir_client_reached_eof(dir_connection_t *conn) escaped(reason)); /* now check if it's got any hints for us about our IP address. */ - if (server_mode(get_options())) { - char *guess = http_get_header(headers, X_ADDRESS_HEADER); - if (guess) { - router_new_address_suggestion(guess); - tor_free(guess); - } + guess = http_get_header(headers, X_ADDRESS_HEADER); + if (guess) { + router_new_address_suggestion(guess); + tor_free(guess); } if (date_header > 0) { |