-
Notifications
You must be signed in to change notification settings - Fork 90
Add support for conditional matching filters based on tags #192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just had one question about the buffer management (which could be totally innocuous, just wasn't sure).
@@ -1472,6 +1495,15 @@ int serializeFilters(char * buffer, size_t bufferSizeAvail, | |||
} | |||
bufferSize++; | |||
|
|||
if (f->tagLen > 0) { | |||
if (buffer) { | |||
buffer[bufferSize] = '#'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to assume the buffer has the space available for this additional data? Wasn't quite sure how that side of things works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep how it works is it calls the function 2 times. The first with nullptr buffer to get the size. The second it specifies a buffer of that size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, got it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are risky changes with memory management. I hope unit tests covered it. Looks good otherwise.
d8ec43b
to
e8b9af3
Compare
e8b9af3
to
ba76cab
Compare
ba76cab
to
8ddfa91
Compare
See here for a description of the task:
Fix #191