Squashed commit of the following:
commit
af890287cb5c3b13031b0b018e48c78ff804b7ca
Author: Vitalii <vhorbato@cisco.com>
Date: Wed Jul 14 19:10:31 2021 +0300
http_inspect: add peg count for script bytes processed
PEG_CONCURRENT_SESSIONS, PEG_MAX_CONCURRENT_SESSIONS, PEG_SCRIPT_DETECTION,
PEG_PARTIAL_INSPECT, PEG_EXCESS_PARAMS, PEG_PARAMS, PEG_CUTOVERS, PEG_SSL_SEARCH_ABND_EARLY,
PEG_PIPELINED_FLOWS, PEG_PIPELINED_REQUESTS, PEG_TOTAL_BYTES, PEG_JS_INLINE, PEG_JS_EXTERNAL,
- PEG_COUNT_MAX };
+ PEG_JS_BYTES, PEG_COUNT_MAX };
// Result of scanning by splitter
enum ScanResult { SCAN_NOT_FOUND, SCAN_NOT_FOUND_ACCELERATE, SCAN_FOUND, SCAN_FOUND_PIECE,
const char* dst_end, const char*& ptr, char*& dst)
{
auto ret = ctx.normalize(ptr, end - ptr, dst, dst_end - dst);
- ptr = ctx.get_src_next();
+
+ auto next = ctx.get_src_next();
+ HttpModule::increment_peg_counts(PEG_JS_BYTES, next - ptr);
+
+ ptr = next;
dst = ctx.get_dst_next();
return ret;
{ CountType::SUM, "total_bytes", "total HTTP data bytes inspected" },
{ CountType::SUM, "js_inline_scripts", "total number of inline JavaScripts processed" },
{ CountType::SUM, "js_external_scripts", "total number of external JavaScripts processed" },
+ { CountType::SUM, "js_bytes", "total number of JavaScript bytes processed" },
{ CountType::END, nullptr, nullptr }
};