mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00:00
fix: tweak read buffer size to reduce over-reading (#16338)
This commit is contained in:
1 parent
49b3908635
commit
6a04067514
2 files changed
+7
-9
No files matched your search
@@ -81,6 +81,10 @@ func ReadFile(name string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return io.ReadAll(r)
|
||||
}
|
||||
|
||||
// Select bigger blocks when reading at least 50% of a big block.
|
||||
r.SmallFile = st.Size() <= BlockSizeLarge/2
|
||||
|
||||
dst := make([]byte, st.Size())
|
||||
_, err = io.ReadFull(r, dst)
|
||||
return dst, err
|
||||
|
||||
Reference in new issue
Block a user