From d4b4c3515970324a5a0c6f6981ccbd9fb661031c Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sun, 15 Dec 2024 12:22:53 +0800 Subject: [PATCH] telemetry refactor --- source/libs/transport/src/thttp.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index e8f25f4545..f0a626a222 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -1014,14 +1014,6 @@ int32_t taosTelemetryMgtInit(STelemAddrMgmt* mgt, char* defaultAddr) { mgt->recvBufRid = 0; return 0; } -int32_t taosTelemetryMgtGetAddr(STelemAddrMgmt* mgt, char* addr) { - if (mgt->cachedAddr[0] == 0) { - tstrncpy(addr, mgt->defaultAddr, TD_FQDN_LEN); - } else { - tstrncpy(addr, mgt->cachedAddr, TD_FQDN_LEN); - } - return 0; -} void taosTelemetryDestroy(STelemAddrMgmt* mgt) { if (mgt == NULL || mgt->recvBufRid <= 0) { return; @@ -1030,7 +1022,7 @@ void taosTelemetryDestroy(STelemAddrMgmt* mgt) { mgt->recvBufRid = 0; } // TODO: parse http response head By LIB -int32_t taosGetValueFromHttpResp(const char* response, const char* key, char* val) { +static int32_t taosTelemetryGetValueFromHttpResp(const char* response, const char* key, char* val) { if (key == NULL || val == NULL) { return TSDB_CODE_INVALID_PARA; } @@ -1079,7 +1071,7 @@ static int32_t taosGetAddrFromHttpResp(int64_t recvBufRid, char* telemAddr) { return code; } - code = taosGetValueFromHttpResp(pRecv, "report_url", telemAddr); + code = taosTelemetryGetValueFromHttpResp(pRecv, "report_url", telemAddr); taosMemoryFree(pRecv); return code; }