fix invalid read
This commit is contained in:
parent
f097de9fe0
commit
2099a45547
|
@ -487,7 +487,14 @@ int32_t transUtilSWhiteListToStr(SIpWhiteList* pWhiteList, char** ppBuf);
|
|||
|
||||
enum { REQ_STATUS_INIT = 0, REQ_STATUS_PROCESSING };
|
||||
|
||||
#define BUFFER_LIMIT 4
|
||||
#if defined(WINDOWS) || defined(DARWIN)
|
||||
#define BUFFER_LIMIT 1
|
||||
#define STATE_BUFFER_LIMIT 1
|
||||
#else
|
||||
#define BUFFER_LIMIT 4
|
||||
#define STATE_BUFFER_LIMIT 8
|
||||
#endif
|
||||
|
||||
#define HEAP_MISS_HIT_LIMIT 100000
|
||||
#define READ_TIMEOUT 100000
|
||||
|
||||
|
|
|
@ -3251,11 +3251,10 @@ static int32_t getOrCreateHeap(SHashObj* pConnHeapCache, char* key, SHeap** pHea
|
|||
|
||||
static FORCE_INLINE int8_t shouldSWitchToOtherConn(int32_t reqNum, int32_t sentNum, int32_t stateNum) {
|
||||
int32_t total = reqNum + sentNum;
|
||||
if (total >= BUFFER_LIMIT) {
|
||||
if (stateNum >= STATE_BUFFER_LIMIT) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (stateNum >= BUFFER_LIMIT * 2) {
|
||||
if (total >= BUFFER_LIMIT) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue