Skip to content

Commit

Permalink
lib/filterx: fix variable lookup
Browse files Browse the repository at this point in the history
A non-floating (i.e., tied to a LogMessage) FilterX variable is considered invalid if:
- its' generation counter is 0 AND
- the scope is syncable

This is to allow two consecutive FilterX blocks to pass non-floating variables
without calling filterx_scope_sync().
If they would be considered invalid then the changes would be lost in the latter block.
This is because it would fetch it via _pull_variable_from_message() which would
yield the unmodified LogMessageValue.

Signed-off-by: Szilard Parrag <[email protected]>
  • Loading branch information
OverOrion committed Oct 28, 2024
1 parent e93690a commit afd3f19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/filterx/filterx-scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ filterx_scope_lookup_variable(FilterXScope *self, FilterXVariableHandle handle)
if (filterx_variable_handle_is_floating(handle) &&
!v->declared && v->generation != self->generation)
return NULL;
if (!filterx_variable_handle_is_floating(handle) && v->generation == 0 && self->syncable)
return NULL;
return v;
}
return NULL;
Expand Down

0 comments on commit afd3f19

Please sign in to comment.