Skip to content

Commit f5369e7

Browse files
alinVDZachtimusPrime
authored andcommitted
Fixes hanging connections problem (#10)
1 parent 6a3d71e commit f5369e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

splunk/splunk.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ func (c *Client) doRequest(b *bytes.Buffer) error {
158158
return err
159159
}
160160

161+
// need to make sure we close the body to avoid hanging the connection
162+
defer res.Body.Close()
163+
161164
// If statusCode is not good, return error string
162165
switch res.StatusCode {
163166
case 200:

0 commit comments

Comments
 (0)