GeoIPv6 patch

Gregor Kališnik gregor at unimatrix-one.org
Wed Jun 15 14:43:49 MSD 2011


Hi.

On Wednesday 15 of June 2011 03:47:18 you wrote:
> Hello!
> 
> On Tue, Jun 14, 2011 at 07:52:10AM +0200, Gregor Kališnik wrote:
> > Hi.
> > 

> 
> I believe it would be sufficient to just check for geoipv6_t type.
> 
>     ngx_feature_incs="#include <GeoIP.h>"
>     ...
>     ngx_feature_test="geoipv6_t  v6addr;
>                       v6addr.s6_addr[0] = 1;"
> 

I've checked GeoIP.h from geoip-1.4.6 and geoip-1.4.7. Both have geoipv6_t. 
But the 1.4.6 version doesn't support GeoIP City IPv6 version and check for 
geoipv6_t would break compilation when using geoip-1.4.6.

Should I break GeoIP IPv6 code into two parts? First checking for geoipv6_t 
and second checking for GeoCity related define/type?

> 
> IMHO, something like this will be more readable:
> 
> #if (NGX_HAVE_GEOIP_IPV6)
>     val = gcf->country_ipv6
>               ? handler_v6(gcf->country, ngx_http_geoip_addr_v6(r))
> 
>               : handler(gcf->country,
>               : ngx_http_geoip_addr(r));
> 
> #else
>     val = handler(gcf->country, ngx_http_geoip_addr(r));
> #endif
> 
> Just a matter of taste though.
> 

Hope I got the identitation right :) .


Best regards,
Gregor Kališnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx-geoipv6.patch
Type: text/x-patch
Size: 8302 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20110615/ee340753/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20110615/ee340753/attachment.pgp>


More information about the nginx-devel mailing list