Prevent Session.Destroy from leaving open TCP connections

This commit is contained in:
Jared Wasinger 2017-05-25 20:51:27 -07:00
parent 8d00db4836
commit d2ef61d079
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
@ -649,6 +650,8 @@ func (c *Client) write(endpoint string, in, out interface{}, q *WriteOptions) (*
if err := decodeBody(resp, &out); err != nil {
return nil, err
}
} else if _, err := ioutil.ReadAll(resp.Body); err != nil {
return nil, err
}
return wm, nil
}