@@ -378,28 +378,26 @@ where
378378 param. flow_id, prev_info. msg_type, prev_info. time, cur_info. msg_type, cur_info. time,
379379 ) ;
380380
381- if prev_info. time > cur_info. time {
382- if !cur_info. on_blacklist && cur_info. msg_type == LogMessageType :: Request {
383- timeout_counter. timeout [ index] += 1 ;
384- }
385- if !prev_info. on_blacklist && prev_info. msg_type == LogMessageType :: Request {
386- timeout_counter. in_cache [ index] += 1 ;
387- }
388- if !cur_info. on_blacklist {
381+ if cur_info. msg_type == prev_info. msg_type {
382+ let _ = timeout_counter. timeout [ index] . saturating_add ( 1 ) ;
383+
384+ let stats = if !cur_info. on_blacklist {
389385 Some ( L7PerfStats :: from ( & cur_info) )
390386 } else {
391387 None
392- }
388+ } ;
389+ rtt_cache. put ( key, cur_info) . unwrap ( ) ;
390+
391+ stats
393392 } else {
394- if !prev_info . on_blacklist && prev_info . msg_type == LogMessageType :: Request {
395- timeout_counter . timeout [ index ] += 1 ;
393+ if !keep_prev {
394+ rtt_cache . pop ( & key ) ;
396395 }
397- if !cur_info. on_blacklist && cur_info. msg_type == LogMessageType :: Request {
398- timeout_counter. in_cache [ index] += 1 ;
399- }
400- let prev_info = rtt_cache. put ( key, cur_info) . unwrap ( ) ;
401- if !prev_info. on_blacklist {
402- Some ( L7PerfStats :: from ( & prev_info) )
396+
397+ let _ = timeout_counter. in_cache [ index] . saturating_sub ( 1 ) ;
398+
399+ if !cur_info. on_blacklist {
400+ Some ( L7PerfStats :: from ( & cur_info) )
403401 } else {
404402 None
405403 }
0 commit comments