Repository: thrift
Updated Branches:
  refs/heads/master 99255de85 -> 9b3b8d498


THRIFT-3184 Thrift Go leaves file descriptors open
Client: Go
Patch: Prashant Varanasi <[email protected]>

This closes #518


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/9b3b8d49
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/9b3b8d49
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/9b3b8d49

Branch: refs/heads/master
Commit: 9b3b8d4987a34ed732a0c3b9edb757d913c38647
Parents: 99255de
Author: Jens Geyer <[email protected]>
Authored: Fri Jun 12 20:35:02 2015 +0200
Committer: Jens Geyer <[email protected]>
Committed: Fri Jun 12 20:35:23 2015 +0200

----------------------------------------------------------------------
 lib/go/thrift/http_client.go | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/9b3b8d49/lib/go/thrift/http_client.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/http_client.go b/lib/go/thrift/http_client.go
index 2bce078..b7cb101 100644
--- a/lib/go/thrift/http_client.go
+++ b/lib/go/thrift/http_client.go
@@ -183,6 +183,8 @@ func (p *THttpClient) Flush() error {
                return NewTTransportExceptionFromError(err)
        }
        if response.StatusCode != http.StatusOK {
+               // Close the response to avoid leaking file descriptors.
+               response.Body.Close()
                // TODO(pomack) log bad response
                return NewTTransportException(UNKNOWN_TRANSPORT_EXCEPTION, 
"HTTP Response code: "+strconv.Itoa(response.StatusCode))
        }

Reply via email to