From 321ef1c7581e785a9ffbc470cb1018b844cb23d1 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 23 Nov 2023 11:08:23 +0800 Subject: [PATCH] add http test --- source/libs/transport/src/thttp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 7cd043f90d..2507447784 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -196,11 +196,19 @@ static void httpAsyncCb(uv_async_t* handle) { SHttpMsg *msg = NULL, *quitMsg = NULL; queue wq; + QUEUE_INIT(&wq); + + static int32_t BACTHSIZE = 20; + int32_t count = 0; + taosThreadMutexLock(&item->mtx); - QUEUE_MOVE(&item->qmsg, &wq); + while (!QUEUE_IS_EMPTY(&item->qmsg) && count++ < BACTHSIZE) { + queue* h = QUEUE_HEAD(&item->qmsg); + QUEUE_REMOVE(h); + QUEUE_PUSH(&wq, h); + } taosThreadMutexUnlock(&item->mtx); - int count = 0; while (!QUEUE_IS_EMPTY(&wq)) { queue* h = QUEUE_HEAD(&wq); QUEUE_REMOVE(h); @@ -370,7 +378,7 @@ static bool httpFailFastShoudIgnoreMsg(SHashObj* pTable, char* server, int16_t p } int64_t now = taosGetTimestampSec(); - if (now - *failedTime < 10) { + if (now - *failedTime < 60) { tError("http-report succ to ignore msg,reason:connection timed out, dst:%s", buf); return true; } else {