Coder Social home page Coder Social logo

Comments (4)

rnowak avatar rnowak commented on May 28, 2024

The third value in the goaway tuple, the error code, would also be great to have access to. This is already translated in cow_http2 by parse_error_code/1. I've so far seen 0 / no_error and 11 / enhance_your_calm emitted in the wild.

from gun.

essen avatar essen commented on May 28, 2024

If the error code is not no_error (equivalent to "normal") it probably should be reflected yes.

from gun.

manas-chaudhari avatar manas-chaudhari commented on May 28, 2024

+1 for this requirement.
I am also willing to take a stab at implementing if I can get some guidance on the approach.

from gun.

essen avatar essen commented on May 28, 2024

The close reason just has to be propagated from gun_http2 to gun. Currently gun_http2 returns the close command, we would need a new command {close, Reason, Extra} that can then be given to the gun_down message. Note that if the Reason is no_error, we should handle it by using normal like currently and not propagate the extra data.

There is additional difficulty because:

  • the connection isn't closed as soon as we receive the GOAWAY frame, so we need to keep the reason/extra data in our state until then
  • the server may send multiple GOAWAY frames during the shutdown; we should keep only the most recent reason/extra data

The last item has the caveat that servers may not send the extra data multiple times, but we'll cross that bridge when we get to it. For now we should just leave a comment in the code indicating that because we keep the last GOAWAY information only, that data may be lost if the server changes what it sends in subsequent GOAWAY frames.

from gun.

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.