File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
crates/enterprise-utils/src
src/flow_generator/protocol_logs Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ pub mod l7 {
3232 }
3333
3434 pub mod custom_field_policy {
35+ use std:: marker:: PhantomData ;
36+
3537 pub mod enums {
3638 use std:: sync:: Arc ;
3739
@@ -89,8 +91,11 @@ pub mod l7 {
8991 }
9092
9193 #[ derive( Clone , Copy , Debug ) ]
92- pub struct PolicySlice ;
93- impl PolicySlice {
94+ pub struct PolicySlice < ' a > {
95+ _marker : PhantomData < & ' a ( ) > ,
96+ }
97+
98+ impl < ' a > PolicySlice < ' a > {
9499 pub fn apply (
95100 & self ,
96101 _: & mut Store ,
@@ -339,6 +344,7 @@ pub mod l7 {
339344
340345 pub mod mq {
341346 pub mod web_sphere_mq {
347+ use public:: l7_protocol:: LogMessageType ;
342348
343349 #[ derive( Default ) ]
344350 pub struct WebSphereMqParser {
@@ -349,7 +355,7 @@ pub mod l7 {
349355 }
350356
351357 impl WebSphereMqParser {
352- pub fn check_payload ( & mut self , _: & [ u8 ] , _: bool ) -> bool {
358+ pub fn check_payload ( & mut self , _: & [ u8 ] , _: bool ) -> Option < LogMessageType > {
353359 unimplemented ! ( )
354360 }
355361
Original file line number Diff line number Diff line change @@ -325,11 +325,7 @@ const RESPONSE_CODE_OK_SUFFIX: &str = "0000";
325325impl L7ProtocolParserInterface for WebSphereMqLog {
326326 fn check_payload ( & mut self , payload : & [ u8 ] , param : & ParseParam ) -> Option < LogMessageType > {
327327 let has_wasm = param. wasm_vm . borrow ( ) . is_some ( ) ;
328- if self . parser . check_payload ( payload, has_wasm) {
329- Some ( LogMessageType :: Request )
330- } else {
331- None
332- }
328+ self . parser . check_payload ( payload, has_wasm)
333329 }
334330
335331 fn parse_payload ( & mut self , payload : & [ u8 ] , param : & ParseParam ) -> Result < L7ParseResult > {
Original file line number Diff line number Diff line change @@ -516,7 +516,7 @@ pub struct DubboLog {
516516#[ cfg( feature = "enterprise" ) ]
517517struct CustomFieldContext < ' a > {
518518 direction : PacketDirection ,
519- policies : Option < PolicySlice > ,
519+ policies : Option < PolicySlice < ' a > > ,
520520 store : & ' a mut Store ,
521521}
522522
You can’t perform that action at this time.
0 commit comments