ftp: per direction tx progress

For request side, having a tx means the request is done.

For response, wait for tx to be marked complete.

Remove unused states.
pull/13146/head
Victor Julien 7 months ago committed by Victor Julien
parent 810a47cd60
commit 3c5ce91cbb

@ -19,9 +19,7 @@
#[repr(u8)]
#[allow(non_camel_case_types)]
pub enum FtpStateValues {
FTP_STATE_NONE,
FTP_STATE_IN_PROGRESS,
FTP_STATE_PORT_DONE,
FTP_STATE_FINISHED,
}
// FTP Data progress values

@ -889,11 +889,11 @@ static int FTPGetAlstateProgress(void *vtx, uint8_t direction)
SCLogDebug("tx %p", vtx);
FTPTransaction *tx = vtx;
if (!tx->done) {
if (direction == STREAM_TOSERVER &&
tx->command_descriptor.command_code == FTP_COMMAND_PORT) {
return FTP_STATE_PORT_DONE;
/* having a tx implies request side is done */
if (direction == STREAM_TOSERVER) {
return FTP_STATE_FINISHED;
}
if (!tx->done) {
return FTP_STATE_IN_PROGRESS;
}

Loading…
Cancel
Save