mod_geoip2_xff update

Thanks to a contribution from Kevin Gaudin, I have a new release of my mod_geoip2 fork. (The history starts here.)

You can find the source here: https://github.com/rvagg/mod_geoip2_xff

Kevin's addition provides a fall-back to the standard remote IP address of the client if no public IP address is found in the X-Forwarded-For header. Previously, my implementation just fell back to the default mod_geoip2 behaviour of just taking the first IP address in the X-Forwarded-For header, or the last if you set GeoIPUseLastXForwardedForIP in your config.

I also took the opportunity to clean things up a little and introduce a config option to turn on the special X-Forwarded-For handling. You now have to set GeoIPUseLeftPublicXForwardedForIP to On to activate it.

Thanks to Kevin, and additional contributions are welcome!

Update July 7th 2012: Since I was in C-mode, I went ahead and implemented something I've tried to get working in the past: hostname lookups on the X-Forwarded-For host! I got intimate with APR and worked out how to use Apache to do the resolution so there isn't the lengthy timeout of raw syscalls. If you set GeoIPEnableHostnameLookups to On, you'll get a GEOIP_HOST environment variable to use.

I've also decided to start making tarballs available off GitHub for your convenience: https://github.com/rvagg/mod_geoip2_xff/downloads