提交 76e5213a 编写于 作者: dengyihao's avatar dengyihao

opt queue

上级 27e6a0c3
......@@ -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
......
......@@ -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));
}
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册