@@ -202,7 +202,10 @@ where
202202 is_reversed : bool ,
203203 ) -> Option < String > {
204204 let key = LogCacheKey :: new ( param, self . session_id ( ) , is_reversed) ;
205- match param. l7_perf_cache . borrow_mut ( ) . rrt_cache . get ( & key) {
205+ let Some ( perf_cache) = param. l7_perf_cache . as_ref ( ) else {
206+ return None ;
207+ } ;
208+ match perf_cache. borrow_mut ( ) . rrt_cache . get ( & key) {
206209 Some ( cached) if cached. endpoint . is_some ( ) => {
207210 let log = LogCache {
208211 time : param. time ,
@@ -234,6 +237,9 @@ where
234237 error ! ( "flow_id: {}, packet time 0" , param. flow_id) ;
235238 return None ;
236239 }
240+ let Some ( perf_cache) = param. l7_perf_cache . as_ref ( ) else {
241+ return None ;
242+ } ;
237243
238244 let cur_info = LogCache {
239245 time : param. time ,
@@ -261,12 +267,10 @@ where
261267 return Some ( stats) ;
262268 }
263269
264- let ( mut rtt_cache, mut timeout_cache) = RefMut :: map_split (
265- param. l7_perf_cache . borrow_mut ( ) ,
266- |perf_cache : & mut L7PerfCache | {
270+ let ( mut rtt_cache, mut timeout_cache) =
271+ RefMut :: map_split ( perf_cache. borrow_mut ( ) , |perf_cache : & mut L7PerfCache | {
267272 ( & mut perf_cache. rrt_cache , & mut perf_cache. timeout_cache )
268- } ,
269- ) ;
273+ } ) ;
270274 let key = LogCacheKey :: new ( param, self . session_id ( ) , self . is_reversed ( ) ) ;
271275 let prev_info = rtt_cache. get_mut ( & key) ;
272276 let timeout_counter = timeout_cache. get_or_insert_mut ( param. flow_id ) ;
0 commit comments