mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Fix a bug in the core files framework with handling the BOF buffer.
- Any files where the total size was below the size of the default bof_buffer size couldn't have stream analyzers successfully attached because the bof_buffer never reached the full size and was never flushed. This branch explicitly marks the buf_buffer as full and flushes it when the file is being removed.
This commit is contained in:
parent
565ad360c6
commit
a97cd1f3a2
3 changed files with 27 additions and 7 deletions
|
@ -492,18 +492,22 @@ void File::EndOfFile()
|
||||||
if ( done )
|
if ( done )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( ! did_mime_type &&
|
|
||||||
LookupFieldDefaultCount(missing_bytes_idx) == 0 )
|
|
||||||
DetectMIME();
|
|
||||||
|
|
||||||
analyzers.DrainModifications();
|
|
||||||
|
|
||||||
if ( file_reassembler )
|
if ( file_reassembler )
|
||||||
{
|
{
|
||||||
file_reassembler->Flush();
|
file_reassembler->Flush();
|
||||||
analyzers.DrainModifications();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mark the bof_buffer as full in case it isn't yet
|
||||||
|
// so that the whole thing can be flushed out to
|
||||||
|
// any stream analyzers.
|
||||||
|
if ( ! bof_buffer.full )
|
||||||
|
{
|
||||||
|
bof_buffer.full = true;
|
||||||
|
DeliverStream((const u_char*) "", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
analyzers.DrainModifications();
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
|
|
||||||
file_analysis::Analyzer* a = 0;
|
file_analysis::Analyzer* a = 0;
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#separator \x09
|
||||||
|
#set_separator ,
|
||||||
|
#empty_field (empty)
|
||||||
|
#unset_field -
|
||||||
|
#path files
|
||||||
|
#open 2015-02-05-13-55-41
|
||||||
|
#fields ts fuid tx_hosts rx_hosts conn_uids source depth analyzers mime_type filename duration local_orig is_orig seen_bytes total_bytes missing_bytes overflow_bytes timedout parent_fuid md5 sha1 sha256 extracted
|
||||||
|
#types time string set[addr] set[addr] set[string] string count set[string] string string interval bool bool count count count count bool string string string string string
|
||||||
|
1362692527.009512 FakNcS1Jfe01uljb3 192.150.187.43 141.142.228.5 CXWv6p3arKYeMETxOg HTTP 0 MD5,SHA1 text/plain - 0.000263 - F 4705 4705 0 0 F - 397168fd09991a0e712254df7bc639ac 1dd7ac0398df6cbc0696445a91ec681facf4dc47 - -
|
||||||
|
#close 2015-02-05-13-55-41
|
|
@ -0,0 +1,6 @@
|
||||||
|
# @TEST-EXEC: bro -r $TRACES/http/get.trace %INPUT
|
||||||
|
# @TEST-EXEC: btest-diff files.log
|
||||||
|
|
||||||
|
@load frameworks/files/hash-all-files
|
||||||
|
|
||||||
|
redef default_file_bof_buffer_size=5000;
|
Loading…
Add table
Add a link
Reference in a new issue