]> 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>
Sun, 21 Apr 2024 07:37:13 +0000 (09:37 +0200)
commit390f09692eb99809c679d3f350c7cc185d163e1a
tree40c070911ac02918bf9dfeb95bcfdd119f1b6507
parentfd47e67dc65f9111895c88fb406c938b1f857325
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.
rust/src/http2/detect.rs
rust/src/http2/http2.rs
rust/src/http2/parser.rs