reverseproxy: Pull latest proxy changes from stdlib#4266
Merged
Conversation
|
Oh, nice. I’ll give it a try. Thank you very much! |
Member
|
These changes look great, thanks Francis. The divergence from bugfixes upstream was something I was worried about. I'll wait to approve this until @leafac reports back whether it resolves his issue. |
Member
|
Should we wait for you, @leafac? (Thanks for trying it out, btw) |
|
Yeah, sorry about taking too long to answer. I’ll test this first thing when I get to work. 😃 |
|
👍 I tested and I believe it’s working now 🙌 Thank you everyone for your work. You’re awesome! Here’s what I did in more detail:
Note how the headers came right away. |
Member
Author
|
Excellent! Thanks for confirming @leafac 🎉 |
I went through the commits that touched stdlib's `reverseproxy.go` file, and copied over all the changes that are to code that was copied into Caddy. The commits I pulled changes from: - golang/go@2cc3473 - golang/go@a5cea06 - golang/go@ecdbffd - golang/go@2189852 -golang/go@ca3c0df - golang/go@9c017ff This may also fix #4247 because of the change to `copyResponse` to set `mlw.flushPending = true` right away.
b8e4b9a to
ac934b2
Compare
francislavoie
added a commit
that referenced
this pull request
Aug 22, 2021
From reading through the code, I think this code path is now obsoleted by the changes made in #4266. Basically, `h.flushInterval()` will set the flush interval to `-1` if we're in a bi-directional stream, and the recent PR ensured that `h.copyResponse()` properly flushes headers immediately when the flush interval is non-zero. So now there should be no need to call Flush before calling `h.copyResponse()`.
mholt
pushed a commit
that referenced
this pull request
Aug 23, 2021
From reading through the code, I think this code path is now obsoleted by the changes made in #4266. Basically, `h.flushInterval()` will set the flush interval to `-1` if we're in a bi-directional stream, and the recent PR ensured that `h.copyResponse()` properly flushes headers immediately when the flush interval is non-zero. So now there should be no need to call Flush before calling `h.copyResponse()`.
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.
I went through the commits that touched stdlib's
reverseproxy.gofile in the past couple of years (only a dozen or so), and copied over all the changes that are to code that was copied into Caddy.The commits I pulled changes from (hopefully apparent from looking at those commits what the changes in this PR are doing):
This may also fix #4247 because of the change to
copyResponseto setmlw.flushPending = trueright away. /cc @leafac if you'd be willing to try out this PR (you can grab a build from the CI artifacts, or build from this commit withxcaddy) to see if it fixes your usecase.