mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

And added an event called "event_queue_flush_point" to mark where that occured in the event stream. The FAF now uses an explicit event queue flush instead of buffering input in order to wait for a file handle to be returned from script-layer.
31 lines
765 B
Text
31 lines
765 B
Text
@load ./main
|
|
@load ./utils
|
|
@load base/utils/conn-ids
|
|
@load base/frameworks/file-analysis/main
|
|
|
|
module HTTP;
|
|
|
|
export {
|
|
## Default file handle provider for HTTP.
|
|
global get_file_handle: function(c: connection, is_orig: bool): string;
|
|
}
|
|
|
|
function get_file_handle(c: connection, is_orig: bool): string
|
|
{
|
|
if ( ! c?$http ) return "";
|
|
|
|
if ( c$http$range_request )
|
|
return fmt("%s %s %s %s", ANALYZER_HTTP, is_orig, c$id$orig_h,
|
|
build_url(c$http));
|
|
|
|
return fmt("%s %s %s %s %s", ANALYZER_HTTP, c$start_time, is_orig,
|
|
c$http$trans_depth, id_string(c$id));
|
|
}
|
|
|
|
module GLOBAL;
|
|
|
|
event get_file_handle(tag: AnalyzerTag, c: connection, is_orig: bool)
|
|
{
|
|
if ( tag != ANALYZER_HTTP ) return;
|
|
set_file_handle(HTTP::get_file_handle(c, is_orig));
|
|
}
|