Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
Add GEOIP_ADDR thats the address used to compute the geoip informatio…
Browse files Browse the repository at this point in the history
…n. Exported as env, notes or both as usual ( Jason Caldwell )
  • Loading branch information
borisz committed Jun 4, 2008
1 parent 5390e8b commit 003eefb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,4 +1,5 @@
- Try to run always before mod_setenvif and mod_rewrite. ( Boris Zentner )
- Add GEOIP_ADDR thats the address used to compute the geoip information. Exported as env, notes or both as usual ( Jason Caldwell )
- Try to run always before mod_setenvif and mod_rewrite. ( Boris Zentner )
1.2.3 Apr 26th 2008
- Skip files that we can not open for some reason ( permission/typo ). Check and skip empty slots in geoip_header_parser ( Boris Zentner )
- Slight performance increase - don't make per_dir ap_get_module_config call where we return DECLINED because cfg->GeoIPEnabled is true (Guenter Knauf)
Expand Down
10 changes: 9 additions & 1 deletion README
@@ -1,4 +1,4 @@
mod_geoip2 1.2.1
mod_geoip2 1.2.3
----------------

======== OVERVIEW =========
Expand Down Expand Up @@ -76,6 +76,14 @@ You may change the output charset fom latin1 ( iso-8859-1 ) to utf8 with:

Output variables set:

GEOIP_ADDR is the address used to calculate the geoip information. Either the ipaddress you came
from, or if you use GeoIPScanProxyHeaders On, the first defined environment
variable HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, the http header X-Forwarded-For or the environment
variable HTTP_REMOTE_ADDR.

GEOIP_ADDR is always exported, when mod_geoip is used.


GeoIP Country Edition:
You can retrieve the ISO 3166 Country code from the Apache notes table
under the "GEOIP_COUNTRY_CODE" key, or from the environment variable
Expand Down
7 changes: 7 additions & 0 deletions mod_geoip.c
Expand Up @@ -388,6 +388,13 @@ geoip_header_parser(request_rec * r)
}
#endif

if (cfg->GeoIPOutput & GEOIP_NOTES) {
apr_table_setn(r->notes, "GEOIP_ADDR", ipaddr);
}
if (cfg->GeoIPOutput & GEOIP_ENV) {
apr_table_setn(r->subprocess_env, "GEOIP_ADDR", ipaddr);
}

for (i = 0; i < cfg->numGeoIPFiles; i++) {

/*
Expand Down

0 comments on commit 003eefb

Please sign in to comment.