From c3caa8475aeafb71da01b9b0526fd2afeaaf26a0 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Mon, 8 Jul 2024 03:25:41 +0000 Subject: [PATCH] add http interface --- source/libs/transport/src/thttp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index c023422427..4370b3d899 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -509,7 +509,6 @@ static void httpHandleReq(SHttpMsg* msg) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto END; } - wb[0] = uv_buf_init((char*)header, strlen(header)); // heap var wb[1] = uv_buf_init((char*)msg->cont, msg->len); // heap var @@ -520,17 +519,17 @@ static void httpHandleReq(SHttpMsg* msg) { goto END; } - cli->wbuf = wb; cli->conn.data = cli; cli->tcp.data = cli; cli->req.data = cli; - cli->addr = msg->server; - cli->port = msg->port; cli->dest = dest; cli->chanId = chanId; + cli->addr = msg->server; + cli->port = msg->port; taosMemoryFree(msg->uri); taosMemoryFree(msg); + cli->wbuf = wb; cli->rbuf = taosMemoryCalloc(1, HTTP_RECV_BUF_SIZE); if (cli->rbuf == NULL) { tError("http-report failed to alloc read buf, dst:%s:%d,chanId:%" PRId64 ", reason:%s", cli->addr, cli->port,