net/http: should writeLoop flush data after writing the request? #33899
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?1.12.9
Does this issue reproduce with the latest release?
Code review. Have question about the code
What operating system and processor architecture are you using (
go env
)?Code review. Have question about the code
go env
OutputWhat did you do?
writeLoop run wr.req.Request.write to send request,when it return err==nil it will run pc.bw.Flush() to flush buffered data.
There are two ways for wr.req.Request.write returning nil
waitForContinue return nil, the waitForContinue function will be waitForContinue, the only way waitForContinue returns false is when the persistConn close. In this case , there will no way to flush the buffered data
bw.Flush() and return nil. So it has flushed the buffered data.(And if bw) is nil, it won‘t need to flush
What did you expect to see?
writeLoop should not run Flush()
What did you see instead?
The text was updated successfully, but these errors were encountered: