]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
htp: remove usused file flags
authorVictor Julien <victor@inliniac.net>
Fri, 26 Jan 2018 10:48:55 +0000 (11:48 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Jan 2018 13:43:51 +0000 (14:43 +0100)
src/app-layer-htp-file.c
src/app-layer-htp.h

index 94dc163caddb3bcee932f824a0a40d5ce53aaeec..2018452ef51d016eb7d912d417f3c04a53239b02 100644 (file)
@@ -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)
     {
index 6dcb04b19a889e3a66c5485d88b915728480fe34..0ede1bb6155dba1be2f2d5bd971378681c86b3fc 100644 (file)
 #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