]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http2: fix for rustc 1.41.1
authorVictor Julien <vjulien@oisf.net>
Mon, 22 Apr 2024 13:41:12 +0000 (15:41 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 22 Apr 2024 13:41:41 +0000 (15:41 +0200)
Co-authored-by: Philippe Antoine <pantoine@oisf.net>
rust/src/http2/detect.rs
rust/src/http2/logger.rs

index ddc3d4a452253e9cb3e6b7ed8723f17939a2c3e9..9e3a5ef63a040ee5d4e880a545b862cb38e62f51 100644 (file)
@@ -490,7 +490,7 @@ fn http2_frames_get_header_firstvalue<'a>(
     for i in 0..frames.len() {
         if let Some(blocks) = http2_header_blocks(&frames[i]) {
             for block in blocks.iter() {
-                if block.name.as_ref() == name.as_bytes() {
+                if &block.name.as_ref()[..] == name.as_bytes() {
                     return Ok(&block.value);
                 }
             }
@@ -513,7 +513,7 @@ fn http2_frames_get_header_value<'a>(
     for i in 0..frames.len() {
         if let Some(blocks) = http2_header_blocks(&frames[i]) {
             for block in blocks.iter() {
-                if block.name.as_ref() == name.as_bytes() {
+                if &block.name.as_ref()[..] == name.as_bytes() {
                     if found == 0 {
                         single = Ok(&block.value);
                         found = 1;
index 0e4f128ca9ee690357ea53bafa5d75db6035da58..064eb2e9f1f5c022f4c7c4f318783660a5549372 100644 (file)
@@ -43,8 +43,7 @@ fn log_http2_headers<'a>(
             parser::HTTP2HeaderDecodeStatus::HTTP2HeaderDecodeSuccess => {
                 if Rc::strong_count(&blocks[j].name) > 2 {
                     // more than one reference in headers table + current headers
-                    let ptr = Rc::as_ptr(&blocks[j].name) as usize;
-                    if !logged_headers.insert(ptr) {
+                    if !logged_headers.insert(blocks[j].name.as_ptr()) {
                         // only log once
                         continue;
                     }