diff --git a/source/libs/transport/inc/transComm.h b/source/libs/transport/inc/transComm.h index 0e809c06b0..a903f26dc9 100644 --- a/source/libs/transport/inc/transComm.h +++ b/source/libs/transport/inc/transComm.h @@ -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 diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index e0411e2891..62c9529389 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -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; }