From 3cf063e1357e266be7f98ba4d09534ae10d7522c Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Wed, 12 Jun 2024 01:40:26 +0000 Subject: [PATCH] fix merge error --- source/libs/transport/src/transCli.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index a065b5dc2a..d075ace7d5 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -247,7 +247,7 @@ typedef struct { int32_t compareHeapNode(const HeapNode* a, const HeapNode* b); int transHeapCreate(SHeap* heap, int32_t (*cmpFunc)(const HeapNode* a, const HeapNode* b)); void transHeapDestroy(SHeap* heap); -void transHeapGet(SHeap* heap, SCliConn** p); +int transHeapGet(SHeap* heap, SCliConn** p); int transHeapInsert(SHeap* heap, SCliConn* p); int transHeapDelete(SHeap* heap, SCliConn* p); @@ -1701,8 +1701,6 @@ static SCliConn* getConnFromHeapCache(SHashObj* pConnHeapCache, char* key) { SHeap heap = {0}; transHeapCreate(&heap, compareHeapNode); taosHashPut(pConnHeapCache, key, klen, &heap, sizeof(heap)); - - p = taosHashGet(pConnHeapCache, key, strlen(key)); return NULL; } SCliConn* pConn = NULL; @@ -2985,18 +2983,19 @@ void transHeapDestroy(SHeap* heap) { heapDestroy(heap->heap); } } -void transHeapGet(SHeap* heap, SCliConn** p) { +int transHeapGet(SHeap* heap, SCliConn** p) { if (heapSize(heap->heap) == 0) { *p = NULL; - return; + return -1; } // HeapNode* minNode = headMin(heap->heap); HeapNode* minNode = heapMin(heap->heap); if (minNode == NULL) { *p = NULL; - return; + return -1; } *p = container_of(minNode, SCliConn, node); + return 0; } int transHeapInsert(SHeap* heap, SCliConn* p) { // impl later