geoip2_c 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/ext/geoip2/libmaxminddb/.gitignore +35 -0
  3. data/ext/geoip2/libmaxminddb/.gitmodules +9 -0
  4. data/ext/geoip2/libmaxminddb/.perltidyrc +11 -0
  5. data/ext/geoip2/libmaxminddb/.travis.yml +48 -0
  6. data/ext/geoip2/libmaxminddb/.uncrustify.cfg +78 -0
  7. data/ext/geoip2/libmaxminddb/AUTHORS +0 -0
  8. data/ext/geoip2/libmaxminddb/Changes.md +238 -0
  9. data/ext/geoip2/libmaxminddb/LICENSE +202 -0
  10. data/ext/geoip2/libmaxminddb/Makefile.am +41 -0
  11. data/ext/geoip2/libmaxminddb/NOTICE +13 -0
  12. data/ext/geoip2/libmaxminddb/README.dev.md +58 -0
  13. data/ext/geoip2/libmaxminddb/README.md +122 -0
  14. data/ext/geoip2/libmaxminddb/appveyor.yml +33 -0
  15. data/ext/geoip2/libmaxminddb/bin/Makefile.am +5 -0
  16. data/ext/geoip2/libmaxminddb/bin/mmdblookup.c +397 -0
  17. data/ext/geoip2/libmaxminddb/bootstrap +21 -0
  18. data/ext/geoip2/libmaxminddb/common.mk +7 -0
  19. data/ext/geoip2/libmaxminddb/configure.ac +132 -0
  20. data/ext/geoip2/libmaxminddb/dev-bin/make-man-pages.pl +76 -0
  21. data/ext/geoip2/libmaxminddb/dev-bin/ppa-release.sh +50 -0
  22. data/ext/geoip2/libmaxminddb/dev-bin/regen-prototypes.pl +136 -0
  23. data/ext/geoip2/libmaxminddb/dev-bin/regen-win32-test-projs.pl +54 -0
  24. data/ext/geoip2/libmaxminddb/dev-bin/release.sh +106 -0
  25. data/ext/geoip2/libmaxminddb/dev-bin/uncrustify-all.sh +21 -0
  26. data/ext/geoip2/libmaxminddb/dev-bin/valgrind-all.pl +46 -0
  27. data/ext/geoip2/libmaxminddb/doc/libmaxminddb.md +889 -0
  28. data/ext/geoip2/libmaxminddb/doc/mmdblookup.md +103 -0
  29. data/ext/geoip2/libmaxminddb/include/maxminddb.h +232 -0
  30. data/ext/geoip2/libmaxminddb/include/maxminddb_config.h.in +14 -0
  31. data/ext/geoip2/libmaxminddb/projects/VS12/README.md +59 -0
  32. data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb-release.props +32 -0
  33. data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb-x64.props +14 -0
  34. data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb.props +32 -0
  35. data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb.sln +150 -0
  36. data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb.vcxproj +141 -0
  37. data/ext/geoip2/libmaxminddb/projects/VS12/libmaxminddb.vcxproj.filters +26 -0
  38. data/ext/geoip2/libmaxminddb/projects/VS12/maxminddb_config.h +14 -0
  39. data/ext/geoip2/libmaxminddb/projects/VS12-tests/bad_pointers.vcxproj +105 -0
  40. data/ext/geoip2/libmaxminddb/projects/VS12-tests/basic_lookup.vcxproj +105 -0
  41. data/ext/geoip2/libmaxminddb/projects/VS12-tests/data_entry_list.vcxproj +105 -0
  42. data/ext/geoip2/libmaxminddb/projects/VS12-tests/data_types.vcxproj +105 -0
  43. data/ext/geoip2/libmaxminddb/projects/VS12-tests/dump.vcxproj +105 -0
  44. data/ext/geoip2/libmaxminddb/projects/VS12-tests/get_value.vcxproj +105 -0
  45. data/ext/geoip2/libmaxminddb/projects/VS12-tests/get_value_pointer_bug.vcxproj +105 -0
  46. data/ext/geoip2/libmaxminddb/projects/VS12-tests/ipv4_start_cache.vcxproj +105 -0
  47. data/ext/geoip2/libmaxminddb/projects/VS12-tests/ipv6_lookup_in_ipv4.vcxproj +105 -0
  48. data/ext/geoip2/libmaxminddb/projects/VS12-tests/libtap.vcxproj +85 -0
  49. data/ext/geoip2/libmaxminddb/projects/VS12-tests/maxminddb_test_helper.vcxproj +107 -0
  50. data/ext/geoip2/libmaxminddb/projects/VS12-tests/metadata.vcxproj +105 -0
  51. data/ext/geoip2/libmaxminddb/projects/VS12-tests/metadata_pointers.vcxproj +105 -0
  52. data/ext/geoip2/libmaxminddb/projects/VS12-tests/no_map_get_value.vcxproj +105 -0
  53. data/ext/geoip2/libmaxminddb/projects/VS12-tests/read_node.vcxproj +105 -0
  54. data/ext/geoip2/libmaxminddb/projects/VS12-tests/shared.vcxproj +104 -0
  55. data/ext/geoip2/libmaxminddb/projects/VS12-tests/threads.vcxproj +103 -0
  56. data/ext/geoip2/libmaxminddb/projects/VS12-tests/version.vcxproj +105 -0
  57. data/ext/geoip2/libmaxminddb/projects/test.vcxproj.template +105 -0
  58. data/ext/geoip2/libmaxminddb/src/Makefile.am +9 -0
  59. data/ext/geoip2/libmaxminddb/src/libmaxminddb.pc.in +11 -0
  60. data/ext/geoip2/libmaxminddb/src/maxminddb-compat-util.h +167 -0
  61. data/ext/geoip2/libmaxminddb/src/maxminddb.c +2171 -0
  62. data/ext/geoip2/libmaxminddb/t/Makefile.am +23 -0
  63. data/ext/geoip2/libmaxminddb/t/bad_databases_t.c +66 -0
  64. data/ext/geoip2/libmaxminddb/t/bad_pointers_t.c +53 -0
  65. data/ext/geoip2/libmaxminddb/t/basic_lookup_t.c +172 -0
  66. data/ext/geoip2/libmaxminddb/t/compile_c++_t.pl +107 -0
  67. data/ext/geoip2/libmaxminddb/t/data_entry_list_t.c +353 -0
  68. data/ext/geoip2/libmaxminddb/t/data_types_t.c +439 -0
  69. data/ext/geoip2/libmaxminddb/t/dump_t.c +103 -0
  70. data/ext/geoip2/libmaxminddb/t/get_value_pointer_bug_t.c +66 -0
  71. data/ext/geoip2/libmaxminddb/t/get_value_t.c +249 -0
  72. data/ext/geoip2/libmaxminddb/t/ipv4_start_cache_t.c +36 -0
  73. data/ext/geoip2/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c +48 -0
  74. data/ext/geoip2/libmaxminddb/t/maxminddb_test_helper.c +255 -0
  75. data/ext/geoip2/libmaxminddb/t/maxminddb_test_helper.h +69 -0
  76. data/ext/geoip2/libmaxminddb/t/metadata_pointers_t.c +32 -0
  77. data/ext/geoip2/libmaxminddb/t/metadata_t.c +226 -0
  78. data/ext/geoip2/libmaxminddb/t/mmdblookup_t.pl +158 -0
  79. data/ext/geoip2/libmaxminddb/t/no_map_get_value_t.c +32 -0
  80. data/ext/geoip2/libmaxminddb/t/read_node_t.c +157 -0
  81. data/ext/geoip2/libmaxminddb/t/threads_t.c +196 -0
  82. data/ext/geoip2/libmaxminddb/t/version_t.c +10 -0
  83. data/geoip2_c.gemspec +1 -1
  84. data/lib/geoip2/version.rb +1 -1
  85. metadata +82 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 021246fe592fdc829bb576251e57ee2f81eb694f
4
- data.tar.gz: c4ad0c50ea7c2df9c29d9c332523d8e85a38ae8c
3
+ metadata.gz: d5a69b651e2c52e819229efab1ba68797bc69246
4
+ data.tar.gz: 7765d1030ebe1154284f3f12ce150aae860635ca
5
5
  SHA512:
6
- metadata.gz: e89bbbd8d322974fdc2363810c4da90104ff77b1fc71674e42a23f89c518b25056405999c58fcbf92b9545e426a582f7da90ca03b80ed80199cc033acc5fd61f
7
- data.tar.gz: 4343b73fd0f0a5170c1a6499ff0b0e200f61865efdb4a429bbd42cd924b5ed8f32969920acb7c07e60ad91f96577c0d2a9e84cd61c71f697b6c5f33c61fac84f
6
+ metadata.gz: c8e5f25c78d00756ecbab14d1c1e2c8456c6fd4c2cfa892c70faec80908fef9ed64eaa5d8ec8d502ab90ec71d682adf8d19005a2d302368a452fa69879bda13f
7
+ data.tar.gz: f7cf16c49191c3a19c8c5f0850e55f5dfee66fc7dab13802a7526536ac3d26ba5f1bc49d242ed9c979de7da784ef59a99129b1f0135c530236a891c865fc73cd
@@ -0,0 +1,35 @@
1
+ *.la
2
+ *.lo
3
+ *.o
4
+ *.so
5
+ */.deps
6
+ */.libs
7
+ *~
8
+ .\#*
9
+ .gh-pages
10
+ /INSTALL
11
+ /autom4te.cache
12
+ /bin/country_lookup
13
+ /bin/mmdbdump
14
+ /bin/mmdblookup
15
+ /compile
16
+ /config.*
17
+ /configure
18
+ /depcomp
19
+ /include/maxminddb_config.h
20
+ /install-sh
21
+ /libmaxminddb-*
22
+ /libtool
23
+ /ltmain.sh
24
+ /man
25
+ /missing
26
+ /src/libmaxminddb.pc
27
+ /t/*.log
28
+ /t/*.trs
29
+ /t/*_t
30
+ /test-driver
31
+ Makefile
32
+ Makefile.in
33
+ \#*\#
34
+ aclocal.m4
35
+ stamp-h*
@@ -0,0 +1,9 @@
1
+ [submodule "maxmind-db"]
2
+ path = maxmind-db
3
+ url = https://github.com/maxmind/MaxMind-DB.git
4
+ [submodule "t/libtap"]
5
+ path = t/libtap
6
+ url = https://github.com/zorgnax/libtap.git
7
+ [submodule "t/maxmind-db"]
8
+ path = t/maxmind-db
9
+ url = https://github.com/maxmind/MaxMind-DB.git
@@ -0,0 +1,11 @@
1
+ --blank-lines-before-packages=0
2
+ --iterations=2
3
+ --no-outdent-long-comments
4
+ -bar
5
+ -boc
6
+ -ci=4
7
+ -i=4
8
+ -l=78
9
+ -nolq
10
+ -se
11
+ -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
@@ -0,0 +1,48 @@
1
+ ---
2
+ sudo: false
3
+ addons:
4
+ apt:
5
+ packages:
6
+ - libipc-run3-perl
7
+ coverity_scan:
8
+ project:
9
+ description: Build submitted via Travis CI
10
+ name: maxmind/libmaxminddb
11
+ notification_email: dev-ci@maxmind.com
12
+ build_command_prepend: ./configure; make clean
13
+ build_command: make -j 4
14
+ branch_pattern: .*coverity.*
15
+ language: c
16
+ matrix:
17
+ include:
18
+ - os: linux
19
+ compiler: gcc
20
+ env: MMCFLAGS="-std=c99 -Wall -Wextra -Werror -Wno-unused-parameter"
21
+ - os: osx
22
+ compiler: gcc
23
+ env: MMCFLAGS="-std=c99 -Wall -Wextra -Wno-unused-parameter"
24
+ - os: linux
25
+ compiler: clang
26
+ env: MMCFLAGS="-std=c99 -Wall -Wextra -Werror -Wno-unused-parameter"
27
+ - os: osx
28
+ compiler: clang
29
+ env: MMCFLAGS="-std=c99 -Wall -Wextra -Wno-unused-parameter"
30
+ env:
31
+ global:
32
+ - secure: a2pXNVW/lGrMdJTal+pzH0J5N69RdBErwe2dHU2xDnOeNcDYmiSxmU4Fw52KPYXFzdlR9GuEyZtHtesRQthSHpylcIvfJJCih7EvwbNQ5pfplpT5ri2PKPFWB11ebr6vG23Ucgc5lrqHdgIgv+QtqVmW1IDf0hq62itMpu4MwcQ=
33
+ before_script:
34
+ - ./bootstrap
35
+ - ./configure CFLAGS="$MMCFLAGS" || (cat config.log && false)
36
+ - make
37
+ script:
38
+ - export VERBOSE=1
39
+ - make check
40
+ notifications:
41
+ email:
42
+ on_failure: always
43
+ on_success: change
44
+ recipients:
45
+ - dev-ci@maxmind.com
46
+ slack:
47
+ rooms:
48
+ secure: "CoXYwhwOA8xi4EM84Eo04hfzhZVAwYVWpa7uEvJmwzcTJHSjoz/EJTMhihgW+zOYMQTDlIho/XIkg+Hh4MurZm9OKMLHbqmeQXN0melf3uscLklKLM1fHssZd1HPsP5ALb+tTHe3m+QuSh+2fHGotfMr8QxVkdrVUJUaEsbOfcQ=\n"
@@ -0,0 +1,78 @@
1
+ #
2
+ # based on uncrustify config file for the linux kernel
3
+ #
4
+
5
+ code_width = 80
6
+ indent_case_brace = 4
7
+ indent_columns = 4
8
+ indent_label = 2 # pos: absolute col, neg: relative column
9
+ indent_with_tabs = 0
10
+
11
+ #
12
+ # inter-symbol newlines
13
+ #
14
+ nl_brace_else = remove # "} else" vs "} \n else" - cuddle else
15
+ nl_brace_while = remove # "} while" vs "} \n while" - cuddle while
16
+ nl_do_brace = remove # "do {" vs "do \n {"
17
+ nl_else_brace = remove # "else {" vs "else \n {"
18
+ nl_enum_brace = remove # "enum {" vs "enum \n {"
19
+ nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{"
20
+ nl_fdef_brace = force # "int foo() {" vs "int foo()\n{"
21
+ nl_for_brace = remove # "for () {" vs "for () \n {"
22
+ nl_func_var_def_blk = 0 # don't add newlines after a block of var declarations
23
+ nl_if_brace = remove # "if () {" vs "if () \n {"
24
+ nl_multi_line_define = true
25
+ nl_struct_brace = remove # "struct {" vs "struct \n {"
26
+ nl_switch_brace = remove # "switch () {" vs "switch () \n {"
27
+ nl_union_brace = remove # "union {" vs "union \n {"
28
+ nl_while_brace = remove # "while () {" vs "while () \n {"
29
+
30
+
31
+ #
32
+ # Source code modifications
33
+ #
34
+ mod_full_brace_do = force # "do a--; while ();" vs "do { a--; } while ();"
35
+ mod_full_brace_for = force # "for () a--;" vs "for () { a--; }"
36
+ mod_full_brace_if = force # "if (a) a--;" vs "if (a) { a--; }"
37
+ mod_full_brace_nl = 3 # don't remove if more than 3 newlines
38
+ mod_full_brace_while = force # "while (a) a--;" vs "while (a) { a--; }"
39
+ mod_paren_on_return = remove # "return 1;" vs "return (1);"
40
+
41
+
42
+ #
43
+ # inter-character spacing options
44
+ #
45
+ sp_after_cast = remove # "(int) a" vs "(int)a"
46
+ sp_after_comma = force
47
+ sp_after_sparen = force # "if () {" vs "if (){"
48
+ sp_arith = force
49
+ sp_assign = force
50
+ sp_assign = force
51
+ sp_before_comma = remove
52
+ sp_before_ptr_star = force # "char *foo" vs "char* foo
53
+ sp_before_sparen = force # "if (" vs "if("
54
+ sp_between_ptr_star = remove # "char * *foo" vs "char **foo"
55
+ sp_bool = force
56
+ sp_compare = force
57
+ sp_func_call_paren = remove # "foo (" vs "foo("
58
+ sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
59
+ sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
60
+ sp_inside_braces = force # "{ 1 }" vs "{1}"
61
+ sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
62
+ sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
63
+ sp_inside_sparen = remove
64
+ sp_paren_brace = force
65
+ sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
66
+
67
+ #
68
+ # Aligning stuff
69
+ #
70
+ align_enum_equ_span = 4 # '=' in enum definition
71
+ align_nl_cont = true
72
+ align_on_tabstop = FALSE # align on tabstops
73
+ align_right_cmt_span = 3
74
+ align_struct_init_span = 1
75
+ align_struct_init_span = 3 # align stuff in a structure init '= { }'
76
+ align_var_def_star_style = 2 # void *foo;
77
+ align_var_struct_span = 0
78
+ align_with_tabs = FALSE # use tabs to align
File without changes
@@ -0,0 +1,238 @@
1
+ ## 1.2.1 - 2017-05-15
2
+
3
+ * Use autoconf to check the system's endianness rather than trying to do this
4
+ with compiler-defined macros like `__BYTE_ORDER__`. Apparently this didn't
5
+ work properly on a Sparc system. GitHub #120.
6
+ * Several compiler warnings on Visual C++ were fixed. Pull request by Marcel
7
+ Raad. GitHub #130.
8
+ * Fix segmentation faults found in `MMDB_open()` using afl-fuzz. This
9
+ occurred on corrupt databases that had a data pointer large enough to
10
+ cause an integer overflow when doing bound checking. Reported by Ryan
11
+ Whitworth. GitHub #140.
12
+ * Add --disable-tests option to `configure`. Pull request by Fabrice
13
+ Fontaine. GitHub #136.
14
+
15
+
16
+ ## 1.2.0 - 2016-03-23
17
+
18
+ * Four additional fields were added to the end of the `MMDB_search_node_s`
19
+ struct returned by `MMDB_read_node`. These fields allow the user to iterate
20
+ through the search tree without making undocumented assumptions about how
21
+ this library works internally and without knowing the specific details of
22
+ the database format. GitHub #110.
23
+
24
+
25
+ ## 1.1.5 - 2016-03-20
26
+
27
+ * Previously, reading a database with a pointer in the metadata would cause an
28
+ `MMDB_INVALID_METADATA_ERROR` to be returned. This was due to an invalid
29
+ offset being used when calculating the pointer. The `data_section` and
30
+ `metadata_section` fields now both point to the beginning of the data
31
+ section. Previously, `data_section` pointed to the beginning of the data
32
+ separator. This will not affect anyone using only documented fields from
33
+ `MMDB_s`.
34
+ * `MMDB_lookup_sockaddr` will set `mmdb_error` to
35
+ `MMDB_IPV6_LOOKUP_IN_IPV4_DATABASE_ERROR` if an IPv6 `sockaddr` is looked up
36
+ in an IPv4-only database. Previously only `MMDB_lookup_string` would set
37
+ this error code.
38
+ * When resolving an address, this library now relies on `getaddrinfo` to
39
+ determine the address family rather than trying to guess it itself.
40
+
41
+
42
+ ## 1.1.4 - 2016-01-06
43
+
44
+ * Packaging fixes. The 1.1.3 tarball release contained a lot of extra junk in
45
+ the t/ directory.
46
+
47
+
48
+ ## 1.1.3 - 2016-01-05
49
+
50
+ * Added several additional checks to make sure that we don't attempt to read
51
+ past the end of the databases's data section. Implemented by Tobias
52
+ Stoeckmann. GitHub #103.
53
+ * When searching for the database metadata, there was a bug that caused the
54
+ code to think it had found valid metadata when none existed. In addition,
55
+ this could lead to an attempt to read past the end of the database
56
+ entirely. Finally, if there are multiple metadata markers in the database,
57
+ we treat the final one as the start of the metdata, instead of the first.
58
+ Implemented by Tobias Stoeckmann. GitHub #102.
59
+ * Don't attempt to mmap a file that is too large to be mmapped on the
60
+ system. Implemented by Tobias Stoeckmann. GitHub #101.
61
+ * Added a missing out of memory check when reading a file's
62
+ metadata. Implemented by Tobias Stoeckmann. GitHub #101.
63
+ * Added several additional checks to make sure that we never attempt to
64
+ `malloc` more than `SIZE_MAX` memory, which would lead to integer
65
+ overflow. This could only happen with pathological databases. Implemented by
66
+ Tobias Stoeckmann. GitHub #101.
67
+
68
+
69
+ ## 1.1.2 - 2015-11-16
70
+
71
+ * IMPORTANT: This release includes a number of important security fixes. Among
72
+ these fixes is improved validation of the database metadata. Unfortunately,
73
+ MaxMind GeoIP2 and GeoLite2 databases created earlier than January 28, 2014
74
+ had an invalid data type for the `record_size` in the metadata. Previously
75
+ these databases worked on little endian machines with libmaxminddb but did
76
+ not work on big endian machines. Due to increased safety checks when reading
77
+ the file, these databases will no longer work on any platform. If you are
78
+ using one of these databases, we recommend that you upgrade to the latest
79
+ GeoLite2 or GeoIP2 database
80
+ * Added pkg-config support. If your system supports it, then running `make
81
+ install` now installs a `libmaxminddb.pc` file for pkgconfig. Implemented by
82
+ Jan Vcelak.
83
+ * Several segmentation faults found with afl-fuzz were fixed. These were
84
+ caused by missing bounds checking and missing data type verification checks.
85
+ * `MMDB_get_entry_data_list` will now fail on data structures with a depth
86
+ greater than 512 and data structures that are cyclic. This should not
87
+ affect any known MaxMind DB in production. All databases produced by
88
+ MaxMind have a depth of less than five.
89
+
90
+
91
+ ## 1.1.1 - 2015-07-22
92
+
93
+ * Added `maxminddb-compat-util.h` as a source file to dist.
94
+
95
+
96
+ ## 1.1.0 - 2015-07-21
97
+
98
+ * Previously, when there was an error in `MMDB_open()`, `errno` would
99
+ generally be overwritten during cleanup, preventing a useful value from
100
+ being returned to the caller. This was changed so that the `errno` value
101
+ from the function call that caused the error is restored before returning to
102
+ the caller. In particular, this is important for `MMDB_IO_ERROR` errors as
103
+ checking `errno` is often the only way to determine what actually failed.
104
+ * If `mmap()` fails due to running out of memory space, an
105
+ `MMDB_OUT_OF_MEMORY_ERROR` is now returned from `MMDB_open` rather than an
106
+ `MMDB_IO_ERROR`.
107
+ * On Windows, the `CreateFileMappingA()` handle was not properly closed if
108
+ opening the database succeeded. Fixed by Bly Hostetler. GitHub #75 & #76.
109
+ * On Windows, we were not checking the return value of `CreateFileMappingA()`
110
+ properly for errors. Fixed by Bly Hotetler. GitHub #78.
111
+ * Several warnings from Clang's scan-build were fixed. GitHub #86.
112
+ * All headers are now installed in `$(includedir)`. GitHub #89.
113
+ * We no longer install `maxminddb-compat-util.h`. This header was intended for
114
+ internal use only.
115
+
116
+
117
+ ## 1.0.4 - 2015-01-02
118
+
119
+ * If you used a non-integer string as an array index when doing a lookup with
120
+ `MMDB_get_value()`, `MMDB_vget_value()`, or `MMDB_aget_value()`, the first
121
+ element of the array would be returned rather than an error. A
122
+ `MMDB_LOOKUP_PATH_DOES_NOT_MATCH_DATA_ERROR` error will now be returned.
123
+ GitHub #61.
124
+ * If a number larger than `LONG_MAX` was used in the same functions,
125
+ `LONG_MAX` would have been used in the lookup. Now a
126
+ `MMDB_INVALID_LOOKUP_PATH_ERROR` error will be returned.
127
+ * Visual Studio build files were added for unit tests and some compatibility
128
+ issues with the tests were fixed.
129
+ * Visual Studio project was updated to use property pages. Patch by Andre.
130
+ GitHub #69.
131
+ * A test failure in `t/compile_c++_t.pl` on new installs was fixed.
132
+
133
+
134
+ ## 1.0.3 - 2014-12-02
135
+
136
+ * A memory and file handle leak on Win32 was fixed when getting the database
137
+ size fails. Patch by Federico G. Schwindt. GitHub PR #49.
138
+ * Documentation fix. Federico G. Schwindt. GitHub PR #50.
139
+ * Added Visual Studio build files and fixed incorrect CreateFileMappingA
140
+ usage. Patch by Andre. GitHub #52.
141
+ * The includes for the Windows header files were made lowercase in order to
142
+ match the actual file names on case-sensitive file systems. GitHub PR #57.
143
+ * Removed `realloc()` calls that caused warnings on Windows and generally
144
+ cleaned up memory allocation in `MMDB_vget_value()`. See relevant discussion
145
+ in GitHub #52.
146
+ * Added an `extern "C" { ... }` wrapper to maxminddb.h when compiling with a
147
+ C++ compiler. GitHub #55.
148
+
149
+
150
+ ## 1.0.2 - 2014-09-22
151
+
152
+ * Fixed a number of small issues found by Coverity.
153
+ * When freeing the MMDB struct in `MMDB_close()` we make sure to set the
154
+ pointers to NULL after freeing the memory they point to. This makes it safe
155
+ to call `MMDB_close` more than once on the same `MMDB_s` struct
156
+ pointer. Before this change, calling this function twice on the same pointer
157
+ could cause the code to free memory that belonged to something else in the
158
+ process. Patch by Shuxin Yang. GitHub PR #41.
159
+
160
+
161
+ ## 1.0.1 - 2014-09-03
162
+
163
+ * Added missing LICENSE and NOTICE files to distribution. No code changes.
164
+
165
+
166
+ ## 1.0.0 - 2014-09-02
167
+
168
+ * Bumped version to 1.0.0. No code changes.
169
+
170
+
171
+ ## 0.5.6 - 2014-07-21
172
+
173
+ * There was a leak in the `MMDB_open()` sub when it was called against a file
174
+ which did not contain any MMDB metadata. Reported by Federico
175
+ G. Schwindt. GitHub issue #36.
176
+ * Fixed an error that occurred when passing AI_V4MAPPED to `getaddrinfo()` on
177
+ FreeBSD. Apparently this macro is defined but doesn't work the way we
178
+ expected it to on that platform.
179
+ * Made sure to call `freeaddrinfo()` when a call to `getaddrinfo()` fails but
180
+ still allocated memory.
181
+ * Fixed a segfault in the tests that occurred on FreeBSD if we passed a NULL
182
+ value to `freeaddrinfo()`.
183
+ * Added a missing step to the README.md file for installing from our GitHub
184
+ repository. Patch by Yasith Fernando.
185
+ * Added instructions for installing via Homebrew. Patch by Yasith Fernando.
186
+
187
+
188
+ ## 0.5.5 - 2014-03-11
189
+
190
+ * The previous tarball failed to compile because it was missing the
191
+ src/maxminddb-compat-util.h file. Reported by Günter Grodotzki. GitHub issue
192
+ #18.
193
+
194
+
195
+ ## 0.5.4 - 2014-03-03
196
+
197
+ * Added support for compiling in the MinGW environment. Patch by Michael
198
+ Eisendle.
199
+ * Added const declarations to many spots in the public API. None of these
200
+ should require changes to existing code.
201
+ * Various documentation improvements.
202
+ * Changed the license to the Apache 2.0 license.
203
+
204
+
205
+ ## 0.5.3 - 2013-12-23
206
+
207
+ * The internal value_for_key_as_uint16 method was returning a uint32_t instead
208
+ of a uint16_t. Reported by Robert Wells. GitHub issue #11.
209
+ * The ip_version member of the MMDB_metadata_s struct was a uint8_t, even
210
+ though the docs and spec said it should be a uint16_t. Reported by Robert
211
+ Wells. GitHub issue #11.
212
+ * The mmdblookup_t.pl test now reports that it needs IPC::Run3 to run (which
213
+ it always did, but it didn't tell you this). Patch by Elan Ruusamäe. GitHub
214
+ issue #10.
215
+
216
+
217
+ ## 0.5.2 - 2013-11-20
218
+
219
+ * Running `make` from the tarball failed. This is now fixed.
220
+
221
+
222
+ ## 0.5.1 - 2013-11-20
223
+
224
+ * Renamed MMDB_LOOKUP_PATH_DOES_NOT_MATCH_DATA define to
225
+ MMDB_LOOKUP_PATH_DOES_NOT_MATCH_DATA_ERROR for consistency. Fixes github
226
+ issue #5. Reported by Albert Strasheim.
227
+ * Updated README.md to show git clone with --recursive flag so you get the
228
+ needed submodules. Fixes github issue #4. Reported by Ryan Peck.
229
+ * Fixed some bugs with the MMDB_get_*value functions when navigating a data
230
+ structure that included pointers. Fixes github issue #3. Reported by
231
+ bagadon.
232
+ * Fixed compilation problems on OSX and OpenBSD. We have tested this on OSX
233
+ and OpenBSD 5.4. Fixes github issue #6.
234
+ * Removed some unneeded memory allocations and added const to many variable
235
+ declarations. Based on patches by Timo Teräs. Github issue #8.
236
+ * Added a test that uses threads to check for thread safety issue in the
237
+ library.
238
+ * Distro tarball now includes man pages, tests, and test data
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.