mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Add FlowBuffer policy mechanisms
This allows for tunability of the following behaviors: * Minimum flowbuffer capacity to use when parsing a new unit * Threshold at which flowbuffer capacity is contracted back to the minimum after parsing a complete unit and before parsing the next * Maximum flowbuffer capacity to allow when parsing a given unit Failed flowbuffer allocations due to reaching maximum capacity or any other reason now throw ExceptionFlowBufferAlloc.
This commit is contained in:
parent
7e6e24a4d8
commit
b4b229acf7
4 changed files with 73 additions and 13 deletions
|
@ -116,6 +116,15 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class ExceptionFlowBufferAlloc : public Exception
|
||||
{
|
||||
public:
|
||||
ExceptionFlowBufferAlloc(const char* reason)
|
||||
{
|
||||
append(binpac_fmt("flowbuffer allocation failed: %s", reason));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // binpac_exception_h
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue