aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-09-30 20:14:15 +0000
committerRoger Dingledine <arma@torproject.org>2006-09-30 20:14:15 +0000
commit0fb7a7de952262c84310f720c798903d0fbeb780 (patch)
treebe2a3e1f7aa1f7f75b83f814f41837ac6cacb975
parentfc9dd98d4cfdf6b5012d15e71a318f6aab8f6121 (diff)
downloadtor-0fb7a7de952262c84310f720c798903d0fbeb780.tar
tor-0fb7a7de952262c84310f720c798903d0fbeb780.tar.gz
Bugfix: when we tunnel our dir fetches via tor, don't believe
the X-Forwarded-For header. svn:r8553
-rw-r--r--src/or/directory.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index a922d81ad..3ac11b6c5 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -837,7 +837,6 @@ 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,
@@ -871,10 +870,12 @@ 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. */
- guess = http_get_header(headers, X_ADDRESS_HEADER);
- if (guess) {
- router_new_address_suggestion(guess);
- tor_free(guess);
+ if (conn->dirconn_direct) {
+ char *guess = http_get_header(headers, X_ADDRESS_HEADER);
+ if (guess) {
+ router_new_address_suggestion(guess);
+ tor_free(guess);
+ }
}
if (date_header > 0) {