Fix influxdb output serialization on connection closed (#6621)

This commit is contained in:
陈方舟
2019-11-14 04:56:01 +08:00
committed by Daniel Nelson
parent 9a2b3bc917
commit fa2f0fff4e
8 changed files with 132 additions and 37 deletions

View File

@@ -176,10 +176,12 @@ func (h *HTTP) write(reqBody []byte) error {
var err error
if h.ContentEncoding == "gzip" {
reqBodyBuffer, err = internal.CompressWithGzip(reqBodyBuffer)
rc, err := internal.CompressWithGzip(reqBodyBuffer)
if err != nil {
return err
}
defer rc.Close()
reqBodyBuffer = rc
}
req, err := http.NewRequest(h.Method, h.URL, reqBodyBuffer)