Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(450)

Unified Diff: src/pkg/net/http/transport.go

Issue 7369056: code review 7369056: net/http: fix a bunch of test leaks (Closed)
Patch Set: diff -r 1e891021e069 https://go.googlecode.com/hg/ Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/net/http/server.go ('k') | src/pkg/net/http/transport_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/net/http/transport.go
===================================================================
--- a/src/pkg/net/http/transport.go
+++ b/src/pkg/net/http/transport.go
@@ -590,11 +590,11 @@
if err == nil {
resp, err = ReadResponse(pc.br, rc.req)
}
+ hasBody := resp != nil && rc.req.Method != "HEAD" && resp.ContentLength != 0
if err != nil {
pc.close()
} else {
- hasBody := rc.req.Method != "HEAD" && resp.ContentLength != 0
if rc.addedGzip && hasBody && resp.Header.Get("Content-Encoding") == "gzip" {
resp.Header.Del("Content-Encoding")
resp.Header.Del("Content-Length")
@@ -614,7 +614,6 @@
alive = false
}
- hasBody := resp != nil && rc.req.Method != "HEAD" && resp.ContentLength != 0
var waitForBodyRead chan bool
if hasBody {
lastbody = resp.Body
« no previous file with comments | « src/pkg/net/http/server.go ('k') | src/pkg/net/http/transport_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b