diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index 7f350a6f1599ba857a4249f500ffcb59bd50985e..c00d8bdebdcead98943628a22d4b886a03532f15 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -409,6 +409,7 @@ static bool httpReadData(HttpContext *pContext) { continue; } else if (errno == EAGAIN || errno == EWOULDBLOCK) { httpDebug("context:%p, fd:%d, read from socket error:%d, wait another event", pContext, pContext->fd, errno); + httpReleaseContext(pContext/*, false */); return false; } else { httpError("context:%p, fd:%d, read from socket error:%d, close connect", pContext, pContext->fd, errno); diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index 25495182498f7c1a82f9f9459290e44f082f5eb2..f74f2bbcc20dd32422cf6c52bd26593db5c23119 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -488,6 +488,12 @@ static int taosReadTcpData(SFdObj *pFdObj, SRecvInfo *pInfo) { msgLen = (int32_t)htonl((uint32_t)rpcHead.msgLen); int32_t size = msgLen + tsRpcOverhead; + // TODO: reason not found yet, workaround to avoid first + if (size < 0) { + tError("%s %p invalid size for malloc, msgLen:%d, size:%d", pThreadObj->label, pFdObj->thandle, msgLen, size); + return -1; + } + buffer = malloc(size); if (NULL == buffer) { tError("%s %p TCP malloc(size:%d) fail", pThreadObj->label, pFdObj->thandle, msgLen);