opt queue
This commit is contained in:
parent
27e6a0c344
commit
76e5213a23
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue