Skip to content
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

reverseproxy: Remove redundant flushing #4299

Merged
merged 1 commit into from
Aug 23, 2021
Merged

reverseproxy: Remove redundant flushing #4299

merged 1 commit into from
Aug 23, 2021

Conversation

francislavoie
Copy link
Member

@francislavoie francislavoie commented 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().


Since this was your code from #3556 and #3561 @masknu, would you mind confirming that your usecase still works correctly with this change, just as a sanity check? Thanks!

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()`.
@francislavoie francislavoie added this to the v2.4.4 milestone Aug 22, 2021
@francislavoie francislavoie added the under review 🧐 Review is pending before merging label Aug 22, 2021
@francislavoie
Copy link
Member Author

francislavoie commented Aug 22, 2021

Well, tests are passing, and there was a test added along with the original change (

// (see https://github.com/caddyserver/caddy/issues/3556 for use case)
func TestH2ToH2CStream(t *testing.T) {
), so I think we're good to go here, so we can merge unless we hear back in the next couple days.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good point. I'll merge this, and we can revert if we find out otherwise.

@mholt mholt merged commit f70a757 into master Aug 23, 2021
@mholt mholt deleted the redundant-flush branch August 23, 2021 17:54
@mholt mholt removed the under review 🧐 Review is pending before merging label Aug 23, 2021
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

Successfully merging this pull request may close these issues.

2 participants