Commit b2052811 authored by Jérome Perrin's avatar Jérome Perrin

close responses

This fixes file descriptor leak which after some time leaves sockets in
CLOSE_WAIT state.
parent 284e0d83
...@@ -99,6 +99,7 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int ...@@ -99,6 +99,7 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
fmt.Fprintf(os.Stderr, "got error %s", err.Error()) fmt.Fprintf(os.Stderr, "got error %s", err.Error())
return output.FLB_RETRY return output.FLB_RETRY
} }
defer rsp.Body.Close()
if rsp.StatusCode != 204 { if rsp.StatusCode != 204 {
fmt.Fprintf(os.Stderr, "status code %d", rsp.StatusCode) fmt.Fprintf(os.Stderr, "status code %d", rsp.StatusCode)
return output.FLB_RETRY return output.FLB_RETRY
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment