From 499a9dd8756b4d95a511917c7248506baf6bb44f Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Tue, 10 Dec 2024 10:07:11 +0100 Subject: [PATCH] http: fix http_free_header_table Type: fix Change-Id: I014aebc84d0c219cc0c99120e9cd51fcc520a41c Signed-off-by: Matus Fabian --- extras/hs-test/http_test.go | 10 ++++++++++ src/plugins/http/http.h | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go index e84e67fe395..a65497054d3 100644 --- a/extras/hs-test/http_test.go +++ b/extras/hs-test/http_test.go @@ -1325,6 +1325,16 @@ func HttpHeadersTest(s *NoTopoSuite) { data2, err := io.ReadAll(resp2.Body) s.AssertNil(err, fmt.Sprint(err)) s.AssertContains(string(data2), "", "html content not received") + + /* test cleanup */ + client.CloseIdleConnections() + for nTries := 0; nTries < 10; nTries++ { + o := vpp.Vppctl("show session verbose 2") + if !strings.Contains(o, serverAddress+":80->"+s.HostAddr()) { + break + } + time.Sleep(1 * time.Second) + } } func HttpInvalidHeadersTest(s *NoTopoSuite) { diff --git a/src/plugins/http/http.h b/src/plugins/http/http.h index bcee69b7bb4..7405d3d3bf7 100644 --- a/src/plugins/http/http.h +++ b/src/plugins/http/http.h @@ -924,7 +924,6 @@ http_free_header_table (http_header_table_t *ht) vec_free (ht->headers); vec_free (ht->buf); hash_free (ht->value_by_name); - clib_mem_free (ht); } static uword