-
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
Feature/http range/v29 #6355
Feature/http range/v29 #6355
Conversation
Compares two buffers with their two sizes
adds a container, ie a thread safe hash table whose key is the filename keep a tree of unordered ranges, up to a memcap limit adds HTPFileOpenWithRange to handle like HTPFileOpen if there is a range : open 2 files, one for the whole reassembled, and one only for the current range
Simplify locking by using the THashData lock instead of a separate range lock. Avoid size_t in function arguments. Clean up file handling functions. Implement handling of alloc errors. Rename yaml entry to byterange Unify public api naming
Better structure design to ensure that one flow maximum is owning and appending into the file, adding fileOwning field. Adds also a gap field in a range buffer, so that we can feed the gap on closing, when we are protected from concurrency by a lock, (lock which got removed in the append path) Fixes memcap when encountering a duplicate while inserting in red and black tree Adds many comments
To make concurrency reasoning clearer
so that borrow check gets happy
for future compatibility with rust
A block is determined out of order on opening. But on closing, the gap before it may have been filled. So, we must post-process it, ie iterate over the red and black tree so see what blocks we can get.
Move the content-range parsing code to rust
Codecov Report
@@ Coverage Diff @@
## master #6355 +/- ##
==========================================
- Coverage 76.96% 76.94% -0.03%
==========================================
Files 612 613 +1
Lines 186410 186796 +386
==========================================
+ Hits 143477 143723 +246
- Misses 42933 43073 +140
Flags with carried forward coverage won't be shown. Click here to find out more. |
Includes https://redmine.openinfosecfoundation.org/issues/4117 as well |
Information:
Pipeline 4089 |
|
match unsafe { SC } { | ||
None => panic!("BUG no suricata_config"), | ||
Some(c) => { | ||
//TODO get a file container instead of NULL |
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.
TODO: address or remove comment if its not needed
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.
It will be much easier when we have file per tx
Right now, I should do something like state.files.get(STREAM_TOCLIENT)
but I do not have an easy reference to state
in HTTP2Transaction::free
So, what should we do ?
@@ -350,6 +402,7 @@ pub struct HTTP2State { | |||
transactions: Vec<HTTP2Transaction>, | |||
progress: HTTP2ConnectionState, | |||
pub files: Files, | |||
flow: *const Flow, |
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.
ideally we're not adding this if we can just pass it around as a function argument
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.
Right
@@ -0,0 +1,241 @@ | |||
/* Copyright (C) 2021 Open Information Security Foundation |
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 the parsing of the content-range string the same for http1 and http2? If so I'd like to consolidate the parsing in Rust
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.
whoops already done it seems, please ignore
|
||
return 0; | ||
uint32_t len = bstr_len(rawvalue); | ||
return rs_http2_parse_content_range(range, bstr_ptr(rawvalue), 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.
nit: I don't like that the call has 'http2' in the name
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.
indeed, some leftover from development version when there were 2 parsing functions
squashed into the right commit |
Replaced by #6409 |
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Add more details to the tcp.mss keyword engine analysis output Issue: OISF#6355
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/1576
Describe changes:
suricata-verify-pr: 531
OISF/suricata-verify#531
Continues #6354 with
For testing : https://github.com/jasonish/suricata-http-range-test