For a done transaction with command PORT,
we expect FTP_STATE_FINISHED
and we got FTP_STATE_PORT_DONE instead
which prevented logging of these transactions
We change the order of the evaluations to get the right result
SCLogDebug("tx %p", vtx);
FTPTransaction *tx = vtx;
- if (direction == STREAM_TOSERVER &&
- tx->command_descriptor->command == FTP_COMMAND_PORT) {
- return FTP_STATE_PORT_DONE;
- }
-
- if (!tx->done)
+ if (!tx->done) {
+ if (direction == STREAM_TOSERVER &&
+ tx->command_descriptor->command == FTP_COMMAND_PORT) {
+ return FTP_STATE_PORT_DONE;
+ }
return FTP_STATE_IN_PROGRESS;
+ }
return FTP_STATE_FINISHED;
}