http: fix segfault when idle timer fires before request headers received.#3970
Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom Jul 28, 2018
Merged
http: fix segfault when idle timer fires before request headers received.#3970mattklein123 merged 4 commits intoenvoyproxy:masterfrom
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
Conversation
…ved. Risk Level: Low Testing: New unit test. Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Member
Author
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks for jumping on this.
| connection_manager_.stats_.named_.downstream_rq_idle_timeout_.inc(); | ||
| // If headers have not been sent to the user, send a 408. | ||
| if (response_headers_ != nullptr) { | ||
| if (request_headers_ == nullptr || response_headers_ != nullptr) { |
Member
There was a problem hiding this comment.
I think it's actually OK to send a reply if there are no request headers, we just can't do the gRPC check. I think this is what we want since you would still get a 408 request timeout response.
Member
Author
There was a problem hiding this comment.
Yes, I can do this, but we need to do a bit more plumbing, since sendLocalReply() doesn't work out of the box today for responses sent before request headers (e.g. it needs them to detect upgrades).
Member
There was a problem hiding this comment.
Oh, alright. Hmm. Probably not worth it. Add a comment maybe?
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
mattklein123
approved these changes
Jul 28, 2018
PiotrSikora
added a commit
to PiotrSikora/proxy
that referenced
this pull request
Jul 30, 2018
Cherry-pick envoyproxy/envoy#3970. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Risk Level: Low
Testing: New unit test.
Signed-off-by: Harvey Tuch htuch@google.com