Fix cleanup of pipe in GetObjectNInfo handlers (#6509)

This commit is contained in:
Aditya Manthramurthy
2018-09-21 11:42:06 -07:00
committed by kannappanr
parent 36e51d0cee
commit 3c8fabd116
9 changed files with 34 additions and 9 deletions

View File

@@ -259,7 +259,8 @@ func (c cacheObjects) GetObjectNInfo(ctx context.Context, bucket, object string,
}()
cleanupBackend := func() { bkReader.Close() }
gr = NewGetObjectReaderFromReader(teeReader, bkReader.ObjInfo, cleanupBackend)
cleanupPipe := func() { pipeReader.Close() }
gr = NewGetObjectReaderFromReader(teeReader, bkReader.ObjInfo, cleanupBackend, cleanupPipe)
return gr, nil
}