[mirrorbrain-commits] r8265 - /trunk/mod_mirrorbrain/mod_mirrorbrain.c

From: <poeml_at_mirrorbrain.org>
Date: Sat, 31 Mar 2012 20:03:28 -0000
Author: poeml
Date: Sat Mar 31 22:03:28 2012
New Revision: 8265

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8265&view=rev
Log:
mod_mirrorbrain:
- enable geolocation by country for IPv6 clients. Requires GeoIP 1.4.8 and
  mod_geoip 1.2.7 or newer (which offer experimental support).

Modified:
    trunk/mod_mirrorbrain/mod_mirrorbrain.c

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=8265&r1=8264&r2=8265&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c	(original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c	Sat Mar 31 22:03:28 2012
_at_@ -1793,6 +1793,14 @@
     state_id = apr_table_get(r->subprocess_env, "GEOIP_REGION");
     state_name = apr_table_get(r->subprocess_env, "GEOIP_REGION_NAME");
 
+    /* IPv6 is experimentally supported in mod_geoip >= 1.2.7 and GeoIP >= 1.4.8 */
+    if (!country_code) 
+        country_code = apr_table_get(r->subprocess_env, "GEOIP_COUNTRY_CODE_V6");
+    if (!country_name) 
+        country_name = apr_table_get(r->subprocess_env, "GEOIP_COUNTRY_NAME_V6");
+    if (!continent_code) 
+        continent_code = apr_table_get(r->subprocess_env, "GEOIP_CONTINENT_CODE_V6");
+
     if (!country_code) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "[mod_mirrorbrain] could not resolve country");
         country_code = "--";




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sat Mar 31 2012 - 20:03:30 GMT

This archive was generated by hypermail 2.3.0 : Sat Mar 31 2012 - 20:17:03 GMT