Code Monkey home page Code Monkey logo

Comments (5)

essen avatar essen commented on June 3, 2024 1

No need for another clause, it'll end up unmatched until the very last clause which asks for more data.

from cowlib.

essen avatar essen commented on June 3, 2024

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.

beligante avatar beligante commented on June 3, 2024

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.

essen avatar essen commented on June 3, 2024

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.

beligante avatar beligante commented on June 3, 2024

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
  • Last clause will be - as you said - match for Length =/= 4
    • This clause will return the Frame Size Error

from cowlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.