From: Victor Julien Date: Fri, 26 Jan 2018 10:48:55 +0000 (+0100) Subject: htp: remove usused file flags X-Git-Tag: suricata-4.1.0-beta1~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ca71beb031c9d4c76a62449426d9ac91651ce61;p=thirdparty%2Fsuricata.git htp: remove usused file flags --- diff --git a/src/app-layer-htp-file.c b/src/app-layer-htp-file.c index 94dc163cad..2018452ef5 100644 --- a/src/app-layer-htp-file.c +++ b/src/app-layer-htp-file.c @@ -83,7 +83,6 @@ int HTPFileOpen(HtpState *s, const uint8_t *filename, uint16_t filename_len, int retval = 0; uint16_t flags = 0; FileContainer *files = NULL; - FileContainer *files_opposite = NULL; const StreamingBufferConfig *sbcfg = NULL; SCLogDebug("data %p data_len %"PRIu32, data, data_len); @@ -102,7 +101,6 @@ int HTPFileOpen(HtpState *s, const uint8_t *filename, uint16_t filename_len, } files = s->files_tc; - files_opposite = s->files_ts; flags = FileFlowToFlags(s->f, STREAM_TOCLIENT); @@ -126,7 +124,6 @@ int HTPFileOpen(HtpState *s, const uint8_t *filename, uint16_t filename_len, } files = s->files_ts; - files_opposite = s->files_tc; flags = FileFlowToFlags(s->f, STREAM_TOSERVER); if ((s->flags & HTP_FLAG_STORE_FILES_TC) || @@ -140,31 +137,6 @@ int HTPFileOpen(HtpState *s, const uint8_t *filename, uint16_t filename_len, sbcfg = &s->cfg->request.sbcfg; } - /* if the previous file is in the same txid, we reset the file part of the - * stateful detection engine. We cannot do that here directly, because of - * locking order. Flow is locked at this point and we can't lock flow - * before de_state */ - if (files != NULL && files->tail != NULL && files->tail->txid == txid) { - SCLogDebug("new file in same tx, flagging http state for de_state reset"); - - if (direction & STREAM_TOCLIENT) { - s->flags |= HTP_FLAG_NEW_FILE_TX_TC; - } else { - s->flags |= HTP_FLAG_NEW_FILE_TX_TS; - } - } - if (files_opposite != NULL && files_opposite->tail != NULL && files_opposite->tail->txid == txid) { - SCLogDebug("new file in same tx, flagging http state for de_state reset"); - - if (direction & STREAM_TOCLIENT) { - SCLogDebug("flagging TC"); - s->flags |= HTP_FLAG_NEW_FILE_TX_TC; - } else { - SCLogDebug("flagging TS"); - s->flags |= HTP_FLAG_NEW_FILE_TX_TS; - } - } - if (FileOpenFile(files, sbcfg, filename, filename_len, data, data_len, flags) == NULL) { diff --git a/src/app-layer-htp.h b/src/app-layer-htp.h index 6dcb04b19a..0ede1bb615 100644 --- a/src/app-layer-htp.h +++ b/src/app-layer-htp.h @@ -66,10 +66,6 @@ #define HTP_FLAG_STORE_FILES_TC 0x0080 #define HTP_FLAG_STORE_FILES_TX_TS 0x0100 #define HTP_FLAG_STORE_FILES_TX_TC 0x0200 -/** flag the state that a new file has been set in this tx */ -#define HTP_FLAG_NEW_FILE_TX_TS 0x0400 -/** flag the state that a new file has been set in this tx */ -#define HTP_FLAG_NEW_FILE_TX_TC 0x0800 enum { HTP_BODY_NONE = 0, /**< Flag to indicate the current