diff --git a/probe/docker/container.go b/probe/docker/container.go index fa3fac9a2c..9a948f2897 100644 --- a/probe/docker/container.go +++ b/probe/docker/container.go @@ -182,8 +182,7 @@ func (c *container) StartGatheringStats() error { return } - bufReader := bufio.NewReaderSize(dial, 8192) - conn := NewClientConnStub(dial, bufReader) + conn := NewClientConnStub(dial, nil) resp, err := conn.Do(req) if err != nil { log.Errorf("docker container: %v", err) @@ -204,7 +203,8 @@ func (c *container) StartGatheringStats() error { }() var stats docker.Stats - decoder := codec.NewDecoder(resp.Body, &codec.JsonHandle{}) + bufReader := bufio.NewReader(resp.Body) + decoder := codec.NewDecoder(bufReader, &codec.JsonHandle{}) for err := decoder.Decode(&stats); err != io.EOF; err = decoder.Decode(&stats) { if err != nil { log.Errorf("docker container: error reading event, did container stop? %v", err)