diff --git a/rust/htp/src/request.rs b/rust/htp/src/request.rs index b132e0762f..faa1a8e452 100644 --- a/rust/htp/src/request.rs +++ b/rust/htp/src/request.rs @@ -400,10 +400,14 @@ impl ConnectionParser { let (len, ext) = parse_chunked_length(&data2)?; self.request_chunked_length = len; if ext { - htp_warn!( + let mut flags = 0; // unused but needed by macro + htp_warn_once!( self.logger, HtpLogCode::REQUEST_CHUNK_EXTENSION, - "Request chunk extension" + "Request chunk extension", + self.request_mut().unwrap().flags, + flags, + HtpFlags::FIELD_REQ_CHUNK_EXTENSION ); } let len = len.as_ref().ok_or(HtpStatus::ERROR).map_err(|e| { diff --git a/rust/htp/src/response.rs b/rust/htp/src/response.rs index 2a3038c97e..1bcc20a221 100644 --- a/rust/htp/src/response.rs +++ b/rust/htp/src/response.rs @@ -222,10 +222,14 @@ impl ConnectionParser { Ok((len, ext)) => { self.response_chunked_length = len; if ext { - htp_warn!( + let mut flags = 0; // unused but needed by macro + htp_warn_once!( self.logger, HtpLogCode::RESPONSE_CHUNK_EXTENSION, - "Response chunk extension" + "Response chunk extension", + self.response_mut().unwrap().flags, + flags, + HtpFlags::FIELD_RESP_CHUNK_EXTENSION ); } // Handle chunk length diff --git a/rust/htp/src/util.rs b/rust/htp/src/util.rs index ff38dfbe7b..dda40cb745 100644 --- a/rust/htp/src/util.rs +++ b/rust/htp/src/util.rs @@ -143,6 +143,10 @@ impl HtpFlags { pub const HEADERS_TOO_MANY: u64 = 0x0040_0000_0000; /// 100-Continue already seen. pub const FIELD_100_CONTINUE: u64 = 0x0080_0000_0000; + /// Request chunk extension, log only once. + pub const FIELD_REQ_CHUNK_EXTENSION: u64 = 0x0100_0000_0000; + /// Response chunk extension, log only once. + pub const FIELD_RESP_CHUNK_EXTENSION: u64 = 0x0200_0000_0000; } #[allow(clippy::upper_case_acronyms)]