From 1857355a2c3000f65ff43f2641174f020943ab01 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Sat, 20 Feb 2021 14:55:31 +0800 Subject: [PATCH 1/2] http-headers/Connection: fix connection header parsing --- src/plugins/http/src/httpParser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/http/src/httpParser.c b/src/plugins/http/src/httpParser.c index e537253f0d..4ce54a8ee6 100644 --- a/src/plugins/http/src/httpParser.c +++ b/src/plugins/http/src/httpParser.c @@ -229,7 +229,7 @@ static int32_t httpOnParseHeaderField(HttpParser *parser, const char *key, const return 0; } - else if (strncasecmp(key, "Connection: ", 12) == 0) { + else if (strncasecmp(key, "Connection", 10) == 0) { if (strncasecmp(val, "Keep-Alive", 10) == 0) { parser->keepAlive = HTTP_KEEPALIVE_ENABLE; } else { From e26a472e91a0037c12f87550b0f5642b0add949b Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Sat, 20 Feb 2021 15:36:34 +0800 Subject: [PATCH 2/2] [TD-2996]: reset pContext->singleCmd to zeroes when httpReleaseContext(pContext, true) --- src/plugins/http/src/httpContext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/http/src/httpContext.c b/src/plugins/http/src/httpContext.c index f71a84a5af..e4f59f4595 100644 --- a/src/plugins/http/src/httpContext.c +++ b/src/plugins/http/src/httpContext.c @@ -155,6 +155,7 @@ void httpReleaseContext(HttpContext *pContext, bool clearRes) { if (clearRes) { httpClearParser(pContext->parser); + memset(&pContext->singleCmd, 0, sizeof(HttpSqlCmd)); } HttpContext **ppContext = pContext->ppContext;