Code review comment for lp:~axwalk/goose/close-response

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+216822_code.launchpad.net,

Message:
Please take a look.

Description:
http: close response body if unused

BinaryRequest calls may discard the response
without closing it. This was causing sockets
to be left open in juju-core/provider/openstack
tests, leading to test failures.

https://code.launchpad.net/~axwalk/goose/close-response/+merge/216822

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/90540043/

Affected files (+4, -0 lines):
   A [revision details]
   M http/client.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20140124165235-h9rloooc531udms5
+New revision: <email address hidden>

Index: http/client.go
=== modified file 'http/client.go'
--- http/client.go 2013-10-18 01:52:13 +0000
+++ http/client.go 2014-04-23 06:57:55 +0000
@@ -180,6 +180,8 @@
   }
   if reqData.RespReader != nil {
    reqData.RespReader = respBody
+ } else {
+ respBody.Close()
   }
   return
  }

« Back to merge proposal