Bug fixed: Adjust the super header length to 8192 for all client implementation

This commit is contained in:
lionsoul 2017-10-21 12:47:24 +08:00
parent eab6259b13
commit 5f3bddec08
8 changed files with 12 additions and 10 deletions

View File

@ -43,7 +43,9 @@ typedef unsigned int uint_t;
typedef unsigned long ulong_t;
#define INDEX_BLOCK_LENGTH 12
#define TOTAL_HEADER_LENGTH 4096
//thats 8 * 1024
#define TOTAL_HEADER_LENGTH 8192
/*
* ip2region properties struct

View File

@ -44,7 +44,7 @@ typedef unsigned int uint_t;
typedef unsigned long ulong_t;
#define INDEX_BLOCK_LENGTH 12
#define TOTAL_HEADER_LENGTH 4096
#define TOTAL_HEADER_LENGTH 8192
/*
* ip2region properties struct

View File

@ -9,8 +9,8 @@ import (
)
const (
INDEX_BLOCK_LENGTH = 12
TOTAL_HEADER_LENGTH = 4096
INDEX_BLOCK_LENGTH = 12
TOTAL_HEADER_LENGTH = 8192
)
var err error

View File

@ -32,12 +32,12 @@ public class DbConfig
}
this.totalHeaderSize = totalHeaderSize;
this.indexBlockSize = 4096; //4 * 1024
this.indexBlockSize = 8192; //4 * 2048
}
public DbConfig() throws DbMakerConfigException
{
this(8192);
this(8 * 2048);
}
public int getTotalHeaderSize()

View File

@ -18,7 +18,7 @@ var lastIndexPtr = 0;
var superBlock = new Buffer(8);
var indexBlockLength = 12;
var totalHeaderLength = 4096;
var totalHeaderLength = 8192;
/**

View File

@ -7,7 +7,7 @@
*/
defined('INDEX_BLOCK_LENGTH') or define('INDEX_BLOCK_LENGTH', 12);
defined('TOTAL_HEADER_LENGTH') or define('TOTAL_HEADER_LENGTH', 4096);
defined('TOTAL_HEADER_LENGTH') or define('TOTAL_HEADER_LENGTH', 8192);
class Ip2Region
{

View File

@ -110,7 +110,7 @@ class Ip2Region(object):
#pass the super block
self.__f.seek(8)
#read the header block
b = self.__f.read(4086)
b = self.__f.read(8192)
#parse the header block
sip = None
ptr = None

View File

@ -110,7 +110,7 @@ class Ip2Region(object):
#pass the super block
self.__f.seek(8)
#read the header block
b = self.__f.read(4086)
b = self.__f.read(8192)
#parse the header block
sip = None
ptr = None