-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Avoid writing to the body after full hijack #151
Conversation
This looks okay to me, but my only thought is whether we should move this to |
Actually a good point, maybe we should (since Do lmk if you want me to split this PR into 2 – happy to do that. |
Yes, let's implement the core functionality in |
As soon as socketry/protocol-http1#30 lands I can update this PR – will only need |
|
Updated this PR to match |
3c3454d
to
73c6b38
Compare
I tried this out and it's working as expected - thanks! |
* Handling partially and fully hijacked connections gracefully * A more precise test of hijacked body * Bumping protocol-http1 and updating hijack check * Closing the body after hijack --------- Co-authored-by: Anton Zhuravsky <anton@lunalabs.uk>
Whenever the application performs hijacking of http/1.1 connection, the server must not attempt to send any response back to the client. Prior to this change, it was not the case due to imprecise check and has led to an error being logged (the real issue occurred during an attempt to write to a stream that was set to nil, but that's really just a symptom).
The proposed fix simply adds a flag to the connection object so that it is aware of the fact the underlying stream no longer belongs to it and must not be used to send any data over.
Types of Changes
Contribution