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

remove buffering of HTTP requests #2626

Merged
merged 2 commits into from
Jul 1, 2020
Merged

Conversation

marten-seemann
Copy link
Member

Fixes #2620.

Only the http.ResponseWriter implements the http.Flusher interface.
We need to make sure that writes to the Request.Body are actually sent out.

@codecov
Copy link

codecov bot commented Jun 24, 2020

Codecov Report

Merging #2626 into master will increase coverage by 0.04%.
The diff coverage is 16.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2626      +/-   ##
==========================================
+ Coverage   86.29%   86.32%   +0.04%     
==========================================
  Files         123      123              
  Lines        9787     9783       -4     
==========================================
  Hits         8445     8445              
+ Misses       1000      997       -3     
+ Partials      342      341       -1     
Impacted Files Coverage Δ
http3/request_writer.go 65.31% <16.67%> (+1.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc047d7...e3a5c31. Read the comment docs.

Only the http.ResponseWriter implements the http.Flusher interface.
We need to make sure that writes to the Request.Body are actually sent out.
@@ -70,20 +68,15 @@ func (w *requestWriter) WriteRequest(str quic.Stream, req *http.Request, gzip bo
}
Copy link
Member

Choose a reason for hiding this comment

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

In line 61 above I think there's a bug: io.Reader allows returning n > 0 together with io.EOF in one, so we should only break if err == io.EOF && n == 0, and also fix the CancelWrite handling.

(GH doesn't allow me to comment on a line that's not part of this commit 🙄

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! That's a separate bug though, I opened #2641 to track it.

@marten-seemann marten-seemann merged commit 6b42c7a into master Jul 1, 2020
@marten-seemann marten-seemann deleted the dont-buffer-http-request branch July 1, 2020 07:13
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
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.

HTTP/3 request timeout with io.PipeReader body
2 participants