diff --git a/rust/src/pop3/pop3.rs b/rust/src/pop3/pop3.rs index 0e1f28dbf2..ee2b277ff1 100644 --- a/rust/src/pop3/pop3.rs +++ b/rust/src/pop3/pop3.rs @@ -541,26 +541,27 @@ impl POP3State { flow, direction::Direction::ToClient as i32, ); - if response.status == sawp_pop3::Status::OK && tx.request.is_some() { - let command = tx.request.as_ref().unwrap(); - SCLogDebug!("command {:?}", command); - match &command.keyword { - sawp_pop3::Keyword::STLS => { - unsafe { - SCAppLayerRequestProtocolTLSUpgrade(flow); - }; + if response.status == sawp_pop3::Status::OK { + if let Some(command) = &tx.request { + SCLogDebug!("command {:?}", command); + match &command.keyword { + sawp_pop3::Keyword::STLS => { + unsafe { + SCAppLayerRequestProtocolTLSUpgrade(flow); + }; + } + sawp_pop3::Keyword::RETR => { + // Don't hold onto the whole email body + + // TODO: pass off to mime parser + response.data.clear(); + } + sawp_pop3::Keyword::AUTH => { + SCLogDebug!("OK on AUTH, expect base64 blob"); + auth_ok = true; + } + _ => {} } - sawp_pop3::Keyword::RETR => { - // Don't hold onto the whole email body - - // TODO: pass off to mime parser - response.data.clear(); - } - sawp_pop3::Keyword::AUTH => { - SCLogDebug!("OK on AUTH, expect base64 blob"); - auth_ok = true; - } - _ => {} } } tx.response = Some(response); diff --git a/rust/src/smb/smb1.rs b/rust/src/smb/smb1.rs index f3937564e7..0084a4e69e 100644 --- a/rust/src/smb/smb1.rs +++ b/rust/src/smb/smb1.rs @@ -854,8 +854,7 @@ pub fn smb1_trans_request_record(state: &mut SMBState, r: &SmbRecord) /* if we have a fid, store it so the response can pick it up */ let mut pipe_dcerpc = false; - if rd.pipe.is_some() { - let pipe = rd.pipe.unwrap(); + if let Some(pipe) = rd.pipe { state.ssn2vec_cache.put(SMBCommonHdr::from1(r, SMBHDR_TYPE_GUID), pipe.fid.to_vec());