From 090533c0feab2d8e7930393a036bb6d027adffa6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 17 Nov 2012 07:52:01 +0100 Subject: mod_geoip: backport --- mod_geoip-1.2.5-httpd24.patch | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 mod_geoip-1.2.5-httpd24.patch (limited to 'mod_geoip-1.2.5-httpd24.patch') diff --git a/mod_geoip-1.2.5-httpd24.patch b/mod_geoip-1.2.5-httpd24.patch new file mode 100644 index 0000000..563e35b --- /dev/null +++ b/mod_geoip-1.2.5-httpd24.patch @@ -0,0 +1,35 @@ +--- mod_geoip.c.geoip ++++ mod_geoip.c +@@ -66,6 +66,7 @@ + #include "http_config.h" + #include "http_protocol.h" + #include "http_log.h" ++#include "util_script.h" + #include "ap_config.h" + #include "apr_strings.h" + #include +@@ -320,7 +321,11 @@ + return DECLINED; + + if (!cfg->scanProxyHeaders) { ++#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) ++ ipaddr = r->useragent_ip; ++#else + ipaddr = r->connection->remote_ip; ++#endif + } + else { + ap_add_common_vars(r); +@@ -338,7 +343,11 @@ + } + if (!ipaddr_ptr) { + ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "[mod_geoip]: Error while getting ipaddr from proxy headers. Using REMOTE_ADDR."); +- ipaddr = r->connection->remote_ip; ++#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) ++ ipaddr = r->useragent_ip; ++#else ++ ipaddr = r->connection->remote_ip; ++#endif + } + else { + ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "[mod_geoip]: IPADDR_PTR: %s", ipaddr_ptr); -- cgit