diff --git a/source/libs/transport/inc/transComm.h b/source/libs/transport/inc/transComm.h index 5f964f6b1ab0e7145f61b25e2e51a1a1d1c86a9e..a41cc0068c3e906ffba65f4bad0feb8847665a55 100644 --- a/source/libs/transport/inc/transComm.h +++ b/source/libs/transport/inc/transComm.h @@ -94,8 +94,8 @@ typedef void* queue[2]; /* Return the structure holding the given element. */ #define QUEUE_DATA(e, type, field) ((type*)((void*)((char*)(e)-offsetof(type, field)))) -//#define TRANS_RETRY_COUNT_LIMIT 100 // retry count limit -//#define TRANS_RETRY_INTERVAL 15 // retry interval (ms) +// #define TRANS_RETRY_COUNT_LIMIT 100 // retry count limit +// #define TRANS_RETRY_INTERVAL 15 // retry interval (ms) #define TRANS_CONN_TIMEOUT 3000 // connect timeout (ms) #define TRANS_READ_TIMEOUT 3000 // read timeout (ms) #define TRANS_PACKET_LIMIT 1024 * 1024 * 512 diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 9cd9b4f7b546ad230efc06c74ce19d98918ac1bf..fbdc17040fd355dbfdaf8229c5aee4cde13fea80 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -864,15 +864,7 @@ void cliSendBatch(SCliConn* pConn) { pHead->magicNum = htonl(TRANS_MAGIC_NUM); } pHead->timestamp = taosHton64(taosGetTimestampUs()); - - if (pHead->comp == 0) { - if (pTransInst->compressSize != -1 && pTransInst->compressSize < pMsg->contLen) { - msgLen = transCompressMsg(pMsg->pCont, pMsg->contLen) + sizeof(STransMsgHead); - pHead->msgLen = (int32_t)htonl((uint32_t)msgLen); - } - } else { - msgLen = (int32_t)ntohl((uint32_t)(pHead->msgLen)); - } + msgLen = (int32_t)ntohl((uint32_t)(pHead->msgLen)); wb[i++] = uv_buf_init((char*)pHead, msgLen); } @@ -972,11 +964,7 @@ static SCliBatch* cliDumpBatch(SCliBatch* pBatch) { SCliBatch* pNewBatch = taosMemoryCalloc(1, sizeof(SCliBatch)); QUEUE_INIT(&pNewBatch->wq); - while (!QUEUE_IS_EMPTY(&pBatch->wq)) { - queue* h = QUEUE_HEAD(&pBatch->wq); - QUEUE_REMOVE(h); - QUEUE_PUSH(&pNewBatch->wq, h); - } + QUEUE_MOVE(&pBatch->wq, &pNewBatch->wq); pNewBatch->batchSize = pBatch->batchSize; pNewBatch->batch = pBatch->batch;