Skip to content

Commit

Permalink
Merge 5327164 into e482166
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiery-Fenix committed Feb 4, 2021
2 parents e482166 + 5327164 commit ed464ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -211,6 +212,8 @@ func (c *conn) killQuery(req *http.Request, args []driver.Value) error {
return err
}
if body != nil {
// Drain body to enable connection reuse
io.Copy(ioutil.Discard, body)
body.Close()
}
return nil
Expand Down Expand Up @@ -248,6 +251,8 @@ func (c *conn) exec(ctx context.Context, query string, args []driver.Value) (dri
}
body, err := c.doRequest(ctx, req)
if body != nil {
// Drain body to enable connection reuse
io.Copy(ioutil.Discard, body)
body.Close()
}
return emptyResult, err
Expand Down

0 comments on commit ed464ad

Please sign in to comment.