aboutsummaryrefslogtreecommitdiff
path: root/src/protozero/filtering/message_filter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/protozero/filtering/message_filter.h')
-rw-r--r--src/protozero/filtering/message_filter.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/protozero/filtering/message_filter.h b/src/protozero/filtering/message_filter.h
index c752b2a78..e67467b6b 100644
--- a/src/protozero/filtering/message_filter.h
+++ b/src/protozero/filtering/message_filter.h
@@ -181,11 +181,20 @@ class MessageFilter {
uint8_t* size_field = nullptr;
uint32_t size_field_len = 0;
- // When true the next |eat_next_bytes| are copied as-is in output.
- // It seems that keeping this field at the end rather than next to
- // |eat_next_bytes| makes the filter a little (but measurably) faster.
- // (likely something related with struct layout vs cache sizes).
- bool passthrough_eaten_bytes = false;
+ // The pointer to the start of the string to update the string if it is
+ // filtered.
+ uint8_t* filter_string_ptr = nullptr;
+
+ // How |eat_next_bytes| should be handled. It seems that keeping this field
+ // at the end rather than next to |eat_next_bytes| makes the filter a little
+ // (but measurably) faster. (likely something related with struct layout vs
+ // cache sizes).
+ enum FilterAction {
+ kDrop,
+ kPassthrough,
+ kFilterString,
+ };
+ FilterAction action = FilterAction::kDrop;
};
uint32_t out_written() { return static_cast<uint32_t>(out_ - &out_buf_[0]); }