Commit Graph

62 Commits (6cffecfe3e6811df72bdba6d2f82f2fd41f6f8fc)

Author SHA1 Message Date
Shivani Bhardwaj 26c7d3cc35 http2: remove needless borrows 5 years ago
Shivani Bhardwaj ee5b300ccf http2: use Direction enum 5 years ago
Shivani Bhardwaj 0c6e9ac931 files: use Direction enum 5 years ago
Sam Muhammed 922a453da5 rust(lint): use is_null() instead of ptr::null_mut()
Bug: #4594
5 years ago
Philippe Antoine 5bd065cb3c range: checks that end is after start for HTTP2
As was done only for HTTP1 in previous commit

The verification part stays separated from the parsing part,
as we want to keep on logging invalid ranges values.
5 years ago
Philippe Antoine 8e8899c90c http2: range: check return value when opening
HttpRangeContainerOpenFile can return NULL
so, http2_range_open can set file_range to NULL
And we should check this before calling http2_range_close
5 years ago
Philippe Antoine 98f84d5a9b http2: follow range requests
Move the content-range parsing code to rust
5 years ago
Philippe Antoine 56fae072b2 http2: better rust lifetimes
so that borrow check gets happy
5 years ago
Philippe Antoine 596a4a9d6e http2: better rust style 5 years ago
Philippe Antoine 48ed874dda http2: concatenate one headers multiple values
For detection, as is done with HTTP1
5 years ago
Philippe Antoine e3ff0e7731 http2: generic http2_header_blocks
so as not to forget continuation and push promise
when iterating over headers
5 years ago
Philippe Antoine 0b0649d98e http2: http.header keyword now works for HTTP2
As well as http.header.raw
5 years ago
Philippe Antoine 9b9f909d7d http2: http.header_names keyword now works for HTTP2 5 years ago
Philippe Antoine 547e9f4ab4 http2: http.host normalized keyword now works for HTTP2 5 years ago
Philippe Antoine 75f75e1eb0 http2: turn Host header into authority during upgrade
HTTP1 uses Host, but HTTP2 uses rather :authority cf HPACK
5 years ago
Philippe Antoine bb98a18b3d http2: better file tracking
If an HTTP2 file was within only ont DATA frame, the filetracker
would open it and close it in the same call, preventing the
firther call to incr_files_opened

Also includes rustfmt again for all HTTP2 files
5 years ago
Philippe Antoine 1378b2f451 http2: support deflate decompression
cf #4556
5 years ago
Victor Julien c1dfb619c4 http2: support per-tx file accounting 5 years ago
Jason Ish cef2832dcf http2: use derived app-layer event 5 years ago
Jason Ish 69cf5c9eea rust(lint): remove needless borrows
These are needless borrows (references) as the item is already
a reference.
5 years ago
Jason Ish 363b5f99c3 rust: functions that reference raw pointers are unsafe
Based on the Rust clippy lint that recommends that any public
function that dereferences a raw pointer, mark all FFI functions
that reference raw pointers with build_slice and cast_pointer
as unsafe.

This commits starts by removing the unsafe wrapper inside
the build_slice and cast_pointer macros then marks all
functions that use these macros as unsafe.

Then fix all not_unsafe_ptr_arg_deref warnings from clippy.

Fixes clippy lint:
https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
5 years ago
Jason Ish 53413f2d7a rust: remove all usage of transmute
All cases of our transmute can be replaced with more idiomatic
solutions and do no require the power of transmute.

When returning an object to C for life-time management, use
Box::into_raw to convert the boxed object to pointer and use
Box::from_raw to convert back.

For cases where we're just returning a pointer to Rust managed
data, use a cast.
5 years ago
Victor Julien 20e8f90981 http2: set Debug on structs 5 years ago
Victor Julien 3587033d9e files: construct with default, free on drop
Update protocols.
5 years ago
Victor Julien d7c3ecb6f9 http2: remove dead code 5 years ago
Philippe Antoine b3c502d572 http2: remove assertion which can be wrong
Brotli decoder stops consuming input it it reaches the
end of its input
5 years ago
Philippe Antoine 999327ba1f http2: http.cookie keyword now works for HTTP2 5 years ago
Philippe Antoine df039555bc http2: http.host.raw keyword now works for HTTP2 5 years ago
Philippe Antoine 1e82d0b3c8 http2: http.method keyword now works for HTTP2 5 years ago
Philippe Antoine 017e39d8fd http2: makes all HTTP1 header keywords work 5 years ago
Philippe Antoine 6fe8bce3b0 http2: have filecontainer for both directions 5 years ago
Philippe Antoine d2d0e0adc9 rust: remove exported unused functions 5 years ago
Philippe Antoine 3de0123ffb http2: adds check about dynamic headers table size 5 years ago
Philippe Antoine 1ca4f041bb http2: pass data through when decompression fails
as is done for HTTP1
5 years ago
Philippe Antoine 5465e0b154 http2: http.stat_msg keyword now works for HTTP2 6 years ago
Philippe Antoine 47928babfc http2: http.user_agent keyword now works for HTTP2 6 years ago
Philippe Antoine a98d0fe6ed http2: http.uri keyword now works for HTTP2
cf #4067
6 years ago
Philippe Antoine 707f027231 protos: renaming ALPROTO_HTTP* constants
Having now ALPROTO_HTTP1, ALPROTO_HTTP2 and ALPROTO_HTTP

Run with 3 sed commands
git grep ALPROTO_HTTP | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP/ALPROTO_HTTP1/g'
git grep ALPROTO_HTTP12 | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP12/ALPROTO_HTTP2/g'
git grep ALPROTO_HTTP1_ANY | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP1_ANY/ALPROTO_HTTP/g'

and then running clang-format
6 years ago
Philippe Antoine d861228214 http2: decompression for files
gzip and brotli decompression for files
6 years ago
Philippe Antoine aee8e60149 rust: better panic message for missing file config 6 years ago
Juliana Fajardini 5226ba1c15 Rust: generic files definition
Issue: Optimization 3825
- filecontainer: add Files structure, to replace/unify SMBFiles,
NFSFiles and HTTP2Files
- smb/files: delete SMBFiles implementation
- smb/smb: replace SMBFiles with Files
- nfs/nfs: delete NFSFiles implementation, replace its former
 declarations with Files' ones
- http2/http2: replace HTTP2Files with Files
- http2/mod: Delete reference to file files.rs
- http2/files: Delete
6 years ago
Victor Julien efc9a7a398 app-layer: remove callback for completion status
Since the completion status was a constant for all parsers, remove the
callback logic and instead register the values themselves. This should
avoid a lot of unnecessary callback calls.

Update all parsers to take advantage of this.
6 years ago
Philippe Antoine f574663352 http2: files inspection API fixes
uses right transaction id for file tracker
uses FILE_USE_DETECT for good matches with keyword startswith
6 years ago
Philippe Antoine a63ee5adbd http2: allow multiple size updates in one headers batch
cf RFC 7541 section 4.2
6 years ago
Philippe Antoine 1fd6f5bc61 http2: asymetric sizes for headers tables
The headers table from client to server
and the one from server to client
may have different maximum sizes
(even if both endpoints have to keep both tables)
6 years ago
Philippe Antoine 64fcba228b http2: complete parsing of priority frames 6 years ago
Philippe Antoine c300a859a0 http2: keep track of dynamic headers table size
And evict entries accordingly to maximum size
6 years ago
Philippe Antoine 1a21eea0e9 http2: variable size integers decoded everywhere 6 years ago
Philippe Antoine b21acfbf21 http2: StreamIdReuse frame types exceptions
Also handles better the state so as not to revert from
HTTP2StateHalfClosedClient to HTTP2StateDataServer and not
go to final HTTP2StateClosed
6 years ago
Philippe Antoine 89573060d9 http2: use variable integer for headers lengths 6 years ago