]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
filestore-call: forcing a call to FileStore instead of manually updating
authorMaurizio Abba <mabba@lastline.com>
Mon, 16 Nov 2015 12:21:27 +0000 (12:21 +0000)
committerVictor Julien <victor@inliniac.net>
Tue, 9 Feb 2016 13:29:50 +0000 (14:29 +0100)
the relative flag in order to have a single point where we actually
touch the File structure

src/util-file.c

index 66d4080e66ba32b540125d13d041fced8a586f80..16a7bd40fe51d5702b7b2bf9426bd34548b733a7 100644 (file)
@@ -535,7 +535,7 @@ File *FileOpenFile(FileContainer *ffc, uint8_t *name,
     }
 
     if (flags & FILE_STORE) {
-        ff->flags |= FILE_STORE;
+        FileStore(ff);
     } else if (flags & FILE_NOSTORE) {
         SCLogDebug("not storing this file");
         ff->flags |= FILE_NOSTORE;
@@ -882,7 +882,7 @@ void FileStoreFileById(FileContainer *fc, uint32_t file_id)
     if (fc != NULL) {
         for (ptr = fc->head; ptr != NULL; ptr = ptr->next) {
             if (ptr->file_id == file_id) {
-                ptr->flags |= FILE_STORE;
+                FileStore(ptr);
             }
         }
     }
@@ -897,7 +897,7 @@ void FileStoreAllFilesForTx(FileContainer *fc, uint64_t tx_id)
     if (fc != NULL) {
         for (ptr = fc->head; ptr != NULL; ptr = ptr->next) {
             if (ptr->txid == tx_id) {
-                ptr->flags |= FILE_STORE;
+                FileStore(ptr);
             }
         }
     }
@@ -911,7 +911,7 @@ void FileStoreAllFiles(FileContainer *fc)
 
     if (fc != NULL) {
         for (ptr = fc->head; ptr != NULL; ptr = ptr->next) {
-            ptr->flags |= FILE_STORE;
+            FileStore(ptr);
         }
     }
 }