]>
Commit | Line | Data |
---|---|---|
9ea79f63 JR |
1 | --- mod_geoip.c.geoip |
2 | +++ mod_geoip.c | |
3 | @@ -66,6 +66,7 @@ | |
4 | #include "http_config.h" | |
5 | #include "http_protocol.h" | |
6 | #include "http_log.h" | |
7 | +#include "util_script.h" | |
8 | #include "ap_config.h" | |
9 | #include "apr_strings.h" | |
10 | #include <GeoIP.h> | |
11 | @@ -320,7 +321,11 @@ | |
12 | return DECLINED; | |
13 | ||
14 | if (!cfg->scanProxyHeaders) { | |
15 | +#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) | |
16 | + ipaddr = r->useragent_ip; | |
17 | +#else | |
18 | ipaddr = r->connection->remote_ip; | |
19 | +#endif | |
20 | } | |
21 | else { | |
22 | ap_add_common_vars(r); | |
23 | @@ -338,7 +343,11 @@ | |
24 | } | |
25 | if (!ipaddr_ptr) { | |
26 | ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "[mod_geoip]: Error while getting ipaddr from proxy headers. Using REMOTE_ADDR."); | |
27 | - ipaddr = r->connection->remote_ip; | |
28 | +#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) | |
29 | + ipaddr = r->useragent_ip; | |
30 | +#else | |
31 | + ipaddr = r->connection->remote_ip; | |
32 | +#endif | |
33 | } | |
34 | else { | |
35 | ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "[mod_geoip]: IPADDR_PTR: %s", ipaddr_ptr); |