mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
weed volume: only store compressed data if compression is effective
This commit is contained in:
parent
b2d92a2992
commit
94302935b2
|
@ -88,12 +88,14 @@ func parseMultipart(r *http.Request) (
|
|||
}
|
||||
isGzipped = true
|
||||
} else if operation.IsGzippable(ext, mtype, data) {
|
||||
if data, e = operation.GzipData(data); e != nil {
|
||||
return
|
||||
}
|
||||
if compressedData, err := operation.GzipData(data); err == nil {
|
||||
if len(data) > len(compressedData) {
|
||||
data = compressedData
|
||||
isGzipped = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue