http: fix http_free_header_table 84/41984/2
authorMatus Fabian <matfabia@cisco.com>
Tue, 10 Dec 2024 09:07:11 +0000 (10:07 +0100)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 10 Dec 2024 17:54:54 +0000 (17:54 +0000)
Type: fix

Change-Id: I014aebc84d0c219cc0c99120e9cd51fcc520a41c
Signed-off-by: Matus Fabian <matfabia@cisco.com>
extras/hs-test/http_test.go
src/plugins/http/http.h

index e84e67f..a654970 100644 (file)
@@ -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>", "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) {
index bcee69b..7405d3d 100644 (file)
@@ -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