Bug fixed: Adjust the super header length to 8192 for all client implementation
This commit is contained in:
parent
4ffb1334a1
commit
b48dbe5248
|
|
@ -43,7 +43,9 @@ typedef unsigned int uint_t;
|
||||||
typedef unsigned long ulong_t;
|
typedef unsigned long ulong_t;
|
||||||
|
|
||||||
#define INDEX_BLOCK_LENGTH 12
|
#define INDEX_BLOCK_LENGTH 12
|
||||||
#define TOTAL_HEADER_LENGTH 4096
|
|
||||||
|
//thats 8 * 1024
|
||||||
|
#define TOTAL_HEADER_LENGTH 8192
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ip2region properties struct
|
* ip2region properties struct
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ typedef unsigned int uint_t;
|
||||||
typedef unsigned long ulong_t;
|
typedef unsigned long ulong_t;
|
||||||
|
|
||||||
#define INDEX_BLOCK_LENGTH 12
|
#define INDEX_BLOCK_LENGTH 12
|
||||||
#define TOTAL_HEADER_LENGTH 4096
|
#define TOTAL_HEADER_LENGTH 8192
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ip2region properties struct
|
* ip2region properties struct
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
INDEX_BLOCK_LENGTH = 12
|
INDEX_BLOCK_LENGTH = 12
|
||||||
TOTAL_HEADER_LENGTH = 4096
|
TOTAL_HEADER_LENGTH = 8192
|
||||||
)
|
)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|
|
||||||
|
|
@ -32,12 +32,12 @@ public class DbConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
this.totalHeaderSize = totalHeaderSize;
|
this.totalHeaderSize = totalHeaderSize;
|
||||||
this.indexBlockSize = 4096; //4 * 1024
|
this.indexBlockSize = 8192; //4 * 2048
|
||||||
}
|
}
|
||||||
|
|
||||||
public DbConfig() throws DbMakerConfigException
|
public DbConfig() throws DbMakerConfigException
|
||||||
{
|
{
|
||||||
this(8192);
|
this(8 * 2048);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTotalHeaderSize()
|
public int getTotalHeaderSize()
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ var lastIndexPtr = 0;
|
||||||
var superBlock = new Buffer(8);
|
var superBlock = new Buffer(8);
|
||||||
|
|
||||||
var indexBlockLength = 12;
|
var indexBlockLength = 12;
|
||||||
var totalHeaderLength = 4096;
|
var totalHeaderLength = 8192;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('INDEX_BLOCK_LENGTH') or define('INDEX_BLOCK_LENGTH', 12);
|
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
|
class Ip2Region
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ class Ip2Region(object):
|
||||||
#pass the super block
|
#pass the super block
|
||||||
self.__f.seek(8)
|
self.__f.seek(8)
|
||||||
#read the header block
|
#read the header block
|
||||||
b = self.__f.read(4086)
|
b = self.__f.read(8192)
|
||||||
#parse the header block
|
#parse the header block
|
||||||
sip = None
|
sip = None
|
||||||
ptr = None
|
ptr = None
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ class Ip2Region(object):
|
||||||
#pass the super block
|
#pass the super block
|
||||||
self.__f.seek(8)
|
self.__f.seek(8)
|
||||||
#read the header block
|
#read the header block
|
||||||
b = self.__f.read(4086)
|
b = self.__f.read(8192)
|
||||||
#parse the header block
|
#parse the header block
|
||||||
sip = None
|
sip = None
|
||||||
ptr = None
|
ptr = None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue