Skip to content

Instantly share code, notes, and snippets.

@shukitchan
Last active August 16, 2020 18:03
Show Gist options
  • Save shukitchan/dc63b60e5d9c519b540390531d06ece3 to your computer and use it in GitHub Desktop.
Save shukitchan/dc63b60e5d9c519b540390531d06ece3 to your computer and use it in GitHub Desktop.
Patch for anjia0532/lua-resty-maxminddb
diff --git lib/resty/maxminddb.lua lib/resty/maxminddb.lua
index 1c72f1a..80acc78 100644
--- lib/resty/maxminddb.lua
+++ lib/resty/maxminddb.lua
@@ -13,14 +13,14 @@
]]
-- copy from https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L5-L12
-local json = require('cjson')
-local json_encode = json.encode
-local json_decode = json.decode
+--local json = require('cjson')
+--local json_encode = json.encode
+--local json_decode = json.decode
-local ngx_log = ngx.log
-local ngx_ERR = ngx.ERR
-local ngx_CRIT = ngx.CRIT
-local ngx_INFO = ngx.INFO
+--local ngx_log = ngx.log
+--local ngx_ERR = ngx.ERR
+--local ngx_CRIT = ngx.CRIT
+--local ngx_INFO = ngx.INFO
local ffi = require ('ffi')
local ffi_new = ffi.new
@@ -36,6 +36,8 @@ local mt = { __index = _M }
-- copy from https://github.com/lilien1010/lua-resty-maxminddb/blob/f96633e2428f8f7bcc1e2a7a28b747b33233a8db/resty/maxminddb.lua#L36-L126
ffi.cdef[[
+typedef long int ssize_t;
+
typedef unsigned int mmdb_uint128_t __attribute__ ((__mode__(TI)));
typedef struct MMDB_entry_s {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment