Skip to content

Commit

Permalink
http2: fix for rustc 1.41.1
Browse files Browse the repository at this point in the history
Co-authored-by: Philippe Antoine <[email protected]>
  • Loading branch information
victorjulien and catenacyber committed Apr 22, 2024
1 parent d24b37a commit cb823d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rust/src/http2/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions rust/src/http2/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cb823d4

Please sign in to comment.