Skip to content

Add on_goaway callback #11

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

Open
pelov opened this issue Jun 17, 2020 · 2 comments
Open

Add on_goaway callback #11

pelov opened this issue Jun 17, 2020 · 2 comments

Comments

@pelov
Copy link

pelov commented Jun 17, 2020

Add a on_goaway callback to Procotol::HTTP2::Client->new. It should be called when the server sends a GOAWAY frame. It should receive last_stream_id, error_code and the additional data (which is usually a text).

Right now, the only way to see these frames is to turn on debugging. However, this frame is important to a client so that it can stop opening new streams and prepare to shutdown the connection. Also the error code and the additional data can be very useful for diagnosing problems.

I don't mind trying to make this change myself - just want to know if I have a green light for that.

@vlet
Copy link
Owner

vlet commented Jun 18, 2020

Feel free to send PR with this feature

pelov pushed a commit to pelov/p5-Protocol-HTTP2 that referenced this issue Jun 18, 2020
On GOAWAY frame, store all the info as a hash in `$con->{goaway}`.
@pelov
Copy link
Author

pelov commented Jun 18, 2020

I figured that a simpler solution would be to store the information from the GOAWAY frame in the $con->{goaway} as a hash with keys last_stream_id, error and data. The above commit does just that.

It works for me but I don't know if it fits well with the rest of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants