head 1.13; access; symbols OPENPKG_2_STABLE_MP:1.13 OPENPKG_E1_MP_HEAD:1.13 OPENPKG_E1_MP:1.13 OPENPKG_E1_MP_2_STABLE:1.13 OPENPKG_E1_FP:1.13 OPENPKG_2_STABLE_20061018:1.13 OPENPKG_2_STABLE:1.13.0.10 OPENPKG_2_STABLE_BP:1.13 OPENPKG_2_5_SOLID:1.13.0.8 OPENPKG_2_5_SOLID_BP:1.13 OPENPKG_2_4_RELEASE:1.13 OPENPKG_2_4_SOLID:1.13.0.6 OPENPKG_2_4_SOLID_BP:1.13 OPENPKG_2_3_RELEASE:1.13 OPENPKG_2_3_SOLID:1.13.0.4 OPENPKG_2_3_SOLID_BP:1.13 OPENPKG_2_2_RELEASE:1.13 OPENPKG_2_2_SOLID:1.13.0.2 OPENPKG_2_2_SOLID_BP:1.13 OPENPKG_2_1_RELEASE:1.11 OPENPKG_2_1_SOLID:1.11.0.4 OPENPKG_2_1_SOLID_BP:1.11 OPENPKG_2_0_RELEASE:1.11 OPENPKG_2_0_SOLID:1.11.0.2 OPENPKG_2_0_SOLID_BP:1.11; locks; strict; comment @# @; 1.13 date 2004.08.09.12.33.45; author tho; state dead; branches; next 1.12; 1.12 date 2004.07.13.17.53.33; author rse; state Exp; branches; next 1.11; 1.11 date 2003.11.15.08.29.24; author rse; state dead; branches; next 1.10; 1.10 date 2003.09.29.07.48.45; author rse; state Exp; branches; next 1.9; 1.9 date 2002.12.30.20.33.48; author rse; state dead; branches; next 1.8; 1.8 date 2002.12.30.08.16.29; author rse; state Exp; branches; next 1.7; 1.7 date 2002.10.29.07.58.48; author rse; state Exp; branches; next 1.6; 1.6 date 2002.10.17.08.43.01; author ps; state dead; branches; next 1.5; 1.5 date 2002.10.05.10.07.48; author rse; state Exp; branches; next 1.4; 1.4 date 2002.08.13.07.51.00; author rse; state dead; branches; next 1.3; 1.3 date 2002.07.31.10.34.25; author rse; state Exp; branches; next 1.2; 1.2 date 2002.07.26.07.56.05; author rse; state Exp; branches; next 1.1; 1.1 date 2002.07.19.08.05.22; author rse; state Exp; branches; next ; desc @@ 1.13 log @upgrading package: geoip 1.3.5 -> 1.3.6 @ text @Yes, gethostbyname_r is thread-safe, but unfortunately too unportable for use within OpenPKG... Index: libGeoIP/GeoIP.c --- libGeoIP/GeoIP.c.orig 2004-06-14 05:09:08 +0200 +++ libGeoIP/GeoIP.c 2004-07-13 19:51:02 +0200 @@@@ -434,32 +434,14 @@@@ unsigned long lookupaddress (const char *host) { unsigned long addr = inet_addr(host); - struct hostent phe2; - struct hostent * phe = &phe2; - char *buf = NULL; - int buflength = 16384; - int herr = 0; + struct hostent *phe; int result = 0; - buf = malloc(buflength); if (addr == INADDR_NONE) { - while (1) { - /* we use gethostbyname_r here because it is thread-safe and gethostbyname is not */ - result = gethostbyname_r(host,&phe2,buf,buflength,&phe,&herr); - if (herr != ERANGE) - break; - if (result == 0) - break; - /* double the buffer if the buffer is too small */ - buflength = buflength * 2; - buf = realloc(buf,buflength); - } + phe = gethostbyname(host); if (!phe) return 0; - if (result != 0) - return 0; addr = *((unsigned long *) phe->h_addr_list[0]); } - free(buf); return ntohl(addr); } @ 1.12 log @upgrading package: geoip 1.3.4 -> 1.3.5 @ text @@ 1.11 log @upgrading package: geoip 1.3.0 -> 1.3.1 @ text @d1 3 d5 36 a40 43 --- libGeoIP/GeoIP.c.orig 2003-09-16 06:36:30.000000000 +0200 +++ libGeoIP/GeoIP.c 2003-09-29 09:47:08.000000000 +0200 @@@@ -34,7 +34,11 @@@@ #endif #include /* For ntohl */ +#if defined(__STDC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include /* For uint32_t */ +#else +#define uint32_t unsigned long +#endif #define COUNTRY_BEGIN 16776960 #define STATE_BEGIN_REV0 16700000 Index: libGeoIP/GeoIPCity.c --- libGeoIP/GeoIPCity.c.orig 2003-09-23 21:30:41.000000000 +0200 +++ libGeoIP/GeoIPCity.c 2003-09-29 09:47:17.000000000 +0200 @@@@ -26,7 +26,11 @@@@ #include #endif #include /* For ntohl */ +#if defined(__STDC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include /* For uint32_t */ +#else +#define uint32_t unsigned long +#endif const int FULL_RECORD_LENGTH = 50; Index: test/test-geoip-region.c --- test/test-geoip-region.c.orig 2003-09-15 06:02:20.000000000 +0200 +++ test/test-geoip-region.c 2003-09-29 09:47:41.000000000 +0200 @@@@ -20,7 +20,11 @@@@ #include #include /* For gethostbyname */ +#if defined(__STDC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include /* For uint32_t */ +#else +#define uint32_t unsigned long +#endif #include /* For ntohl */ #include @ 1.10 log @upgrading package: geoip 1.2.2 -> 1.3.0 @ text @@ 1.9 log @upgrading package: geoip 1.1.3 -> 1.1.4 @ text @d1 45 a45 57 --- libGeoIP/GeoIPBitReader.c.orig 2002-12-17 22:32:37.000000000 +0100 +++ libGeoIP/GeoIPBitReader.c 2002-12-24 08:46:11.000000000 +0100 @@@@ -32,7 +32,7 @@@@ } unsigned long GeoIPBitReader_read(GeoIPBitReader * gibr, short int numBits) { - ulong num = 0; + unsigned long num = 0; int i, bit; int bytes_read; --- apps/Makefile.in.orig 2002-12-30 09:08:32.000000000 +0100 +++ apps/Makefile.in 2002-12-30 09:08:54.000000000 +0100 @@@@ -105,12 +105,12 @@@@ geoipupdate_SOURCES = geoipupdate.c geoipupdate_LDFLAGS = geoipupdate_DEPENDENCIES = $(top_builddir)/libGeoIP/libGeoIP.la $(top_builddir)/libGeoIP/libGeoIPUpdate.la -geoipupdate_LDADD = $(top_builddir)/libGeoIP/libGeoIP.la $(top_builddir)/libGeoIP/libGeoIPUpdate.la +geoipupdate_LDADD = $(top_builddir)/libGeoIP/libGeoIPUpdate.la $(top_builddir)/libGeoIP/libGeoIP.la geoipexport_SOURCES = geoipexport.c geoipexport_LDFLAGS = geoipexport_DEPENDENCIES = $(top_builddir)/libGeoIP/libGeoIP.la $(top_builddir)/libGeoIP/libGeoIPBitReader.la -geoipexport_LDADD = $(top_builddir)/libGeoIP/libGeoIP.la $(top_builddir)/libGeoIP/libGeoIPBitReader.la -lm +geoipexport_LDADD = $(top_builddir)/libGeoIP/libGeoIPBitReader.la -lm $(top_builddir)/libGeoIP/libGeoIP.la subdir = apps mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = --- apps/geoipexport.c.orig 2002-12-17 22:35:21.000000000 +0100 +++ apps/geoipexport.c 2002-12-30 09:14:29.000000000 +0100 @@@@ -41,7 +41,7 @@@@ (int)floor(num/16777216), ((int)floor(num/65536)) % 256, ((int)floor(num/256)) % 256, - num % 256); + (int)(num % 256)); return addr; } @@@@ -78,7 +78,7 @@@@ GeoIPBitReader *gibr; int databaseType, record, val; int exportType; - ulong beginIp = 0, endIp = 0; + unsigned long beginIp = 0, endIp = 0; if (argc < 4) { usage(); @@@@ -127,7 +127,7 @@@@ full_csv_export(databaseType, beginIp, endIp - 1, val, f); } beginIp = endIp; - printf("setting beginIp to %d\n",beginIp); + printf("setting beginIp to %ld\n",beginIp); } else { /* record = netmask - 1 */ endIp += (1 << (31 - record)); @ 1.8 log @upgrading package: geoip 1.1.1 -> 1.1.3 @ text @@ 1.7 log @add patch to CVS, too @ text @d1 4 a4 8 --- libGeoIP/GeoIPUpdate.c.orig Mon Oct 28 06:06:13 2002 +++ libGeoIP/GeoIPUpdate.c Tue Oct 29 08:57:03 2002 @@@@ -28,6 +28,7 @@@@ #include "zlib.h" #include "time.h" #include +#include #include d6 52 a57 11 /* @@@@ -73,7 +74,8 @@@@ char *uncompr = NULL, *compr; unsigned long comprLen; FILE * comp_fh, * cur_db_fh; - gzFile gz_fh, gi_fh; + gzFile gz_fh; + FILE *gi_fh; char * file_path_gz; MD5_CTX context; unsigned char buffer[1024], digest[16]; @ 1.6 log @upgrading package: geoip 1.0.8 -> 1.0.9 @ text @d1 20 a20 10 --- libGeoIP/GeoIPUpdate.c.orig Sat Oct 5 01:06:48 2002 +++ libGeoIP/GeoIPUpdate.c Sat Oct 5 12:06:01 2002 @@@@ -21,6 +21,7 @@@@ #include "global.h" #include "md5.h" #include "GeoIP.h" +#include #include #include #include @ 1.5 log @upgrading package: geoip 1.0.5 -> 1.0.7 @ text @@ 1.4 log @upgrading package: geoip 0.3.0 -> 1.0.0 @ text @d1 5 a5 3 --- apps/geoipupdate.c.orig Thu Jul 18 09:42:03 2002 +++ apps/geoipupdate.c Fri Jul 19 10:00:22 2002 @@@@ -21,7 +21,10 @@@@ d7 4 a10 18 #include #include +#include +#ifdef __linux__ #include +#endif #include #define LICENSE_KEY "LicenseKey" @@@@ -39,7 +42,7 @@@@ int line_index = 0; unsigned char *lineptr = malloc(sizeof(char) * n); char *a_license_key_str, *a_ptr; - char *the_license_key_str; + char *the_license_key_str = ""; char c; int err; @ 1.3 log @New version 0.2.8 includes a call to exit(3), so we don't have to provide a 'return' in our patch anymore. @ text @@ 1.2 log @upgrading package: geoip 0.2.2 -> 0.2.6 @ text @a22 6 @@@@ -128,4 +131,5 @@@@ free(the_license_key_str); GeoIP_delete(gi); + return 0; } @ 1.1 log @upgrading package: geoip 0.2.1 -> 0.2.2 @ text @a0 33 --- libGeoIP/GeoIP.c.orig Thu Jul 18 09:40:29 2002 +++ libGeoIP/GeoIP.c Fri Jul 19 09:51:30 2002 @@@@ -28,10 +28,12 @@@@ #include #include /* for fstat */ #include /* for fstat */ +#include #include "zlib.h" #include "time.h" #include +#include #include #define COUNTRY_BEGIN 16776960; @@@@ -236,7 +238,7 @@@@ int block_size = 1024; char * request_uri; char *uncompr = NULL, *compr; - ulong comprLen, uncomprLen = 1000000; + unsigned long comprLen; FILE * comp_fh; gzFile gz_fh, gi_fh; char * file_path_gz; @@@@ -358,7 +360,7 @@@@ int i, j; unsigned int x[2]; unsigned char buf[2][3]; - unsigned char *cache_buf; + unsigned char *cache_buf = NULL; if (depth == -1) { fprintf(stderr,"Error Traversing Database - Perhaps database is corrupt?\n"); @