Comments (5)
No need for another clause, it'll end up unmatched until the very last clause which asks for more data.
from cowlib.
The clause you linked to in cow_http2 is missing a when Len =/= 4
, it's a little too large in what it matches.
from cowlib.
So, for the use case, I described above. I should ensure that gen_tcp doesn't break the RST_STREAM frames in case the OS Buffers are full. Right? Aka: I might have to open an issue for the Mint client
If I'm not mistaken, the previous clause matches for clauses where Len >= 4
.
parse(<< 4:24, 3:8, _:9, StreamID:31, ErrorCode:32, Rest/bits >>) ->
{ok, {rst_stream, StreamID, parse_error_code(ErrorCode)}, Rest};
If it's > 4
it will parse the error and return the rest of the data. If it's == 4
the Rest
will be <<>>
- That being said, I don't think you need a when
guard here
from cowlib.
Nothing to change in clients. The previous clause doesn't match because Len is the first 24 bits and it's 4 in that clause. We need to make the catch-all a little less catch-all to not match incomplete packets with valid lengths.
from cowlib.
Ahhh Gotcha!
So, wrapping up:
- Add another clause to match the incomplete packet (with valid length, type and stream_id (maybe))
- ask for
more
data
- ask for
- Last clause will be - as you said - match for
Length =/= 4
- This clause will return the Frame Size Error
from cowlib.
Related Issues (20)
- mts mimetype HOT 2
- HPACK encoder must resize table when max_size changes, before encoding HOT 4
- Allow setting a default max_size for the encoder in Cowboy/Gun
- cow_hpack:table_insert may have the state with dyn_table contains entry that is larger than the max_size HOT 1
- Please remove the file ebin/cowlib.app, which prevent the 'make' operation from generating .beam files in ebin. HOT 1
- Allow content-length in 204 reply HOT 6
- Parse delta (integer) values of rfc5861 cache control headers HOT 4
- Add support of no/never indexing for http/2 hpack header encoding HOT 3
- cow_qs:qs/1 percent-encode the reserved characters like comma HOT 1
- cow_http_struct_hd:parse_dictionary fails to properly parse tokens HOT 1
- Crash on malformed Connection header HOT 2
- Structured headers RFC update (draft)
- Remove HTTP/2 PRIORITY support
- Add SH support and tests HOT 1
- It seems that the cowlib 2.8.0 has not been released on hex.pm? HOT 1
- Got error when sending trailers HOT 12
- compression_error HOT 1
- Call gun:cancel may lead to disconnect the whole connection.
- Is there plan to release a new version/tag? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cowlib.