current_context_delete_pending = true;
}
-// Remove file context explicitly
-void FileFlows::remove_processed_file_context(uint64_t file_id, uint64_t multi_file_processing_id)
-{
- bool is_new_context = false;
-
- if (!multi_file_processing_id)
- multi_file_processing_id = file_id;
-
- FileContext* context = get_file_context(file_id, false, is_new_context, multi_file_processing_id);
- if (context)
- {
- set_current_file_context(context);
- context->processing_complete = true;
- remove_processed_file_context(multi_file_processing_id);
- }
-}
-
/* This function is used to process file that is sent in pieces
*
* Return:
if (!cacheable)
context->set_not_cacheable();
- set_current_file_context(context);
+ if(!context->processing_complete)
+ set_current_file_context(context);
+ else
+ current_file_id = file_id;
// Only increase file count when there are no queued segments
// This will ensure we only count a file once in case it has
// Remove a file from the flow object when processing is complete
void remove_processed_file_context(uint64_t file_id);
- void remove_processed_file_context(uint64_t file_id, uint64_t multi_file_processing_id);
-
uint64_t get_new_file_instance();
bool set_file_name(const uint8_t* fname, uint32_t name_size, uint64_t file_id=0,
if ((int64_t)processed_bytes + data_size >= config->file_type_depth)
{
data_size = config->file_type_depth - processed_bytes;
- assert(data_size > 0);
+ if (data_size < 0)
+ return;
depth_exhausted = true;
}
const FileConfig* const conf = get_file_config();
FilePosition position)
{
/* file type already found and no magics to continue */
- find_file_type_from_ips(pkt, file_data, data_size, position);
+ if (SNORT_FILE_TYPE_CONTINUE == file_type_id)
+ find_file_type_from_ips(pkt, file_data, data_size, position);
}
void FileContext::process_file_signature_sha256(const uint8_t* file_data, int data_size,