]> git.ipfire.org Git - thirdparty/suricata.git/commit
http2: use a reference counter for headers
authorPhilippe Antoine <pantoine@oisf.net>
Wed, 27 Mar 2024 13:33:54 +0000 (14:33 +0100)
committerVictor Julien <vjulien@oisf.net>
Mon, 22 Apr 2024 07:27:51 +0000 (09:27 +0200)
commite68ec4b227d19498f364a41eb25d3182f0383ca5
treee3afe4bda48a01c560bd6ff21d9012a7d25cdbb6
parent311002baf288a225f62cf18a90c5fdd294447379
http2: use a reference counter for headers

Ticket: 6892

As HTTP hpack header compression allows one single byte to
express a previously seen arbitrary-size header block (name+value)
we should avoid to copy the vectors data, but just point
to the same data, while reamining memory safe, even in the case
of later headers eviction from the dybnamic table.

Rust std solution is Rc, and the use of clone, so long as the
data is accessed by only one thread.

(cherry picked from commit 390f09692eb99809c679d3f350c7cc185d163e1a)
rust/src/http2/detect.rs
rust/src/http2/http2.rs
rust/src/http2/parser.rs