Propagate FTP preflight cancellation
CI / checks (pull_request) Successful in 2m37s
Agents / bot (pull_request) Successful in 6m58s

This commit is contained in:
Danny Kim
2026-09-30 20:06:43 +09:00
parent a1c449843f
commit 25d572aa33
3 changed files with 34 additions and 2 deletions
+11
View File
@@ -13,6 +13,7 @@ const LISTING: &[u8] = b"type=file;size=3; report.md \r\n";
#[derive(Clone, Copy)]
pub enum Scenario {
CancelledPreflight,
ExpiredListing,
LostMutationReply,
}
@@ -142,6 +143,9 @@ impl Tcp {
state.listings += 1;
"150 Listing\r\n226 Complete\r\n"
}
"NOOP" if matches!(state.scenario, Scenario::CancelledPreflight) => {
return Err(HostError::Cancelled);
}
"NOOP"
if index == 0
&& (matches!(state.scenario, Scenario::LostMutationReply)
@@ -157,6 +161,13 @@ impl Tcp {
state.mkdir_commands += 1;
return Ok(bytes.len() as u32);
}
"MKD /cancelled"
if index == 1
&& matches!(state.scenario, Scenario::CancelledPreflight) =>
{
state.mkdir_commands += 1;
return Err(HostError::Unavailable);
}
_ => return Err(HostError::InvalidInput),
}
};