summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2012-02-09 15:54:00 +0100
committerKarsten Loesing <karsten.loesing@gmx.net>2012-02-09 15:54:00 +0100
commit4741aa48a252db050435ca88e1a013a19a4ab3ed (patch)
tree31be42be47ddf1179abe12204ee537f412e0e463 /src/or
parentcc94a48ff47a59fb6d7ce0a61aebeb6f8f859b2b (diff)
downloadtor-4741aa48a252db050435ca88e1a013a19a4ab3ed.tar.gz
tor-4741aa48a252db050435ca88e1a013a19a4ab3ed.zip
Roger notes that address and addr are two different things.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/directory.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 8d4ac63626..cc5f1bd973 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2843,16 +2843,23 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
goto done;
}
- geoip_note_client_seen(act, &TO_CONN(conn)->addr, time(NULL));
- geoip_note_ns_response(act, GEOIP_SUCCESS);
- /* Note that a request for a network status has started, so that we
- * can measure the download time later on. */
- if (TO_CONN(conn)->dirreq_id)
- geoip_start_dirreq(TO_CONN(conn)->dirreq_id, dlen, act,
- DIRREQ_TUNNELED);
- else
- geoip_start_dirreq(TO_CONN(conn)->global_identifier, dlen, act,
- DIRREQ_DIRECT);
+ {
+ struct in_addr in;
+ tor_addr_t addr;
+ if (tor_inet_aton((TO_CONN(conn))->address, &in)) {
+ tor_addr_from_ipv4h(&addr, ntohl(in.s_addr));
+ geoip_note_client_seen(act, &addr, time(NULL));
+ geoip_note_ns_response(act, GEOIP_SUCCESS);
+ /* Note that a request for a network status has started, so that we
+ * can measure the download time later on. */
+ if (TO_CONN(conn)->dirreq_id)
+ geoip_start_dirreq(TO_CONN(conn)->dirreq_id, dlen, act,
+ DIRREQ_TUNNELED);
+ else
+ geoip_start_dirreq(TO_CONN(conn)->global_identifier, dlen, act,
+ DIRREQ_DIRECT);
+ }
+ }
// note_request(request_type,dlen);
(void) request_type;