From: Philippe Antoine Date: Fri, 7 Jul 2023 08:39:11 +0000 (+0200) Subject: http: remove obsolete checks for files X-Git-Tag: suricata-7.0.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb2fbafed2b41ad1faaca970587af0eb3e08ac35;p=thirdparty%2Fsuricata.git http: remove obsolete checks for files With libhtp having been improved, Suricata does not need to check that there is either a response line or HTTP/0.9 as libhtp will trigger the callbacks only in those cases --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index f3e0ad2e81..ce9fe2b477 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -1766,9 +1766,7 @@ static int HtpResponseBodyHandle(HtpState *hstate, HtpTxUserData *htud, * we check for tx->response_line in case of junk * interpreted as body before response line */ - if (!(htud->tcflags & HTP_FILENAME_SET) && - (tx->response_line != NULL || tx->is_protocol_0_9)) - { + if (!(htud->tcflags & HTP_FILENAME_SET)) { SCLogDebug("setting up file name"); uint8_t *filename = NULL; @@ -1818,9 +1816,7 @@ static int HtpResponseBodyHandle(HtpState *hstate, HtpTxUserData *htud, htud->tcflags &= ~HTP_DONTSTORE; } } - } - else if (tx->response_line != NULL || tx->is_protocol_0_9) - { + } else { /* otherwise, just store the data */ if (!(htud->tcflags & HTP_DONTSTORE)) {