1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-02 11:09:29 +00:00

Fix mod_geoip with recent GeoIP.

Submitted by:	kris/bento, Lew Payne <lew@clickbank.com>
This commit is contained in:
Sean Chittenden 2003-05-19 22:11:33 +00:00
parent 5f0d2ae0fa
commit 39200c9b7a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=81496
2 changed files with 41 additions and 4 deletions

View File

@ -21,10 +21,6 @@ LIB_DEPENDS= GeoIP.3:${PORTSDIR}/net/GeoIP
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 500113
BROKEN= "Does not compile"
.endif
APXS?= ${LOCALBASE}/sbin/apxs
APACHE_PORT?= ${PORTSDIR}/www/apache13

View File

@ -0,0 +1,41 @@
--- mod_geoip.c.orig Mon May 19 15:03:19 2003
+++ mod_geoip.c Mon May 19 15:08:36 2003
@@ -209,7 +209,8 @@
}
databaseType = GeoIP_database_edition(cfg->gip);
- if (databaseType == GEOIP_COUNTRY_EDITION) {
+ switch (databaseType) {
+ case GEOIP_COUNTRY_EDITION:
country_id = GeoIP_country_id_by_addr(cfg->gip, ipaddr);
if (country_id > 0) {
@@ -224,7 +225,8 @@
ap_table_set(r->subprocess_env, "GEOIP_COUNTRY_NAME", country_name);
}
}
- } else if (databaseType == GEOIP_REGION_EDITION) {
+ break;
+ case GEOIP_REGION_EDITION:
giregion = GeoIP_region_by_name (cfg->gip, ipaddr);
if (giregion != NULL) {
if (cfg->GeoIPOutput & GEOIP_NOTES) {
@@ -241,7 +243,9 @@
}
GeoIPRegion_delete(giregion);
}
- } else if (databaseType == GEOIP_CITY_EDITION) {
+ break;
+ case GEOIP_CITY_EDITION_REV0:
+ case GEOIP_CITY_EDITION_REV1:
gir = GeoIP_record_by_addr(cfg->gip, ipaddr);
if (gir != NULL) {
if (cfg->GeoIPOutput & GEOIP_NOTES) {
@@ -261,6 +265,7 @@
ap_table_set(r->subprocess_env, "GEOIP_CITY", gir->city);
}
}
+ break;
}
return OK;
}