-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detect/transforms: write directly in inspect buffer #12125
detect/transforms: write directly in inspect buffer #12125
Conversation
instead of writing to a temporary buffer and then copying, to save the cost of copying. Ticket: 7229 Not a cherry-pick as we do not put the transforms in rust, but just do this optimization in C
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main-7.0.x #12125 +/- ##
==============================================
- Coverage 83.27% 83.18% -0.10%
==============================================
Files 922 922
Lines 260794 260821 +27
==============================================
- Hits 217177 216955 -222
- Misses 43617 43866 +249
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Information: QA ran without warnings. Pipeline 23400 |
* The inspect buffer may have been overallocated (by strip_whitespace for example) | ||
* so, this sets the final length | ||
*/ | ||
void InspectionBufferTruncate(InspectionBuffer *buffer, uint32_t buf_len) |
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.
wonder if we can have a better name here. In my concept of truncation, we reduce the data. Here we just set the correct length, right?
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.
The length is always decreased even if we do not realloc the buffer to regain some memory space...
What name do you propose ? (also this name is already in master)
Merged in #12146, thanks! |
Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/7306
Describe changes:
No cherry-pick, but reusing logic in C instead of rust ;-)
#12100 with review taken into account : more function docs and better cast