Welcome! Log In Create A New Profile

Advanced

Re: [Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Arnaud GRANAL
April 18, 2011 02:46PM
On Mon, Apr 18, 2011 at 9:20 PM, Igor Sysoev <igor@sysoev.ru> wrote:
> On Mon, Apr 18, 2011 at 05:56:09PM +0300, Arnaud GRANAL wrote:
>> Igor Sysoev wrote:
>> >  There is already patch to support GeoIP ISP base:
>> >  http://kornel.neolabs.kz/files/nginx-0.9.7-geoip-isp.patch.bz2
>>
>> >  What is the difference between ISP base and Organization base ?
>>
>> Almost none, organization is more precise but API calls are the same.
>> As far I can see the code is very similar so there is no reason to use my patch.
>
> To get GeoIP_1st patch calls GeoIP_name_by_ipnum(),
> while your patch calls GeoIP_org_by_ipnum() to get organization.
> Do these capabilities exist in both bases ?
>

If you want to merge I suggest using GeoIP_name_by_ipnum() because
this can read AS database, ISP base, Organization base and Domain
base.

GeoIP_org_by_ipnum() is the old function of GeoIP, this is the one
used by the official example:


>From GeoIP official API:
http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.7.tar.gz

GeoIP-1.4.7\apps\geoiplookup.c
else if (GEOIP_ORG_EDITION == i || GEOIP_ISP_EDITION == i) {
org = GeoIP_org_by_ipnum(gi, ipnum);
==
if (GEOIP_DOMAIN_EDITION == i) {
domain_name = GeoIP_name_by_ipnum(gi, ipnum);


However, GeoIP.h states that GeoIP_org_by_ipnum is deprecated, but
paradoxally there are still recommending it in code examples.

I didn't see official code using GeoIP_name_by_ipnum for ISP but it
seems to be ok.


In:
static char *
ngx_http_geoip_city(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)

should add (for cleanup)

+ if (gcf->organization) {
+ GeoIP_delete(gcf->organization);
+ }
+

A.

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Arnaud GRANAL 2882 April 18, 2011 09:48AM

Re: [Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Arnaud GRANAL 640 April 18, 2011 09:50AM

Re: [Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Igor Sysoev 780 April 18, 2011 10:04AM

Re: [Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Arnaud GRANAL 655 April 18, 2011 10:58AM

Re: [Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Igor Sysoev 761 April 18, 2011 02:22PM

Re: [Patch][GeoIP][1.0.0] GeoIP Organization / ISP support

Arnaud GRANAL 868 April 18, 2011 02:46PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready