mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
weed volume: only store compressed data if compression is effective
This commit is contained in:
parent
b2d92a2992
commit
94302935b2
@ -88,10 +88,12 @@ 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
|
||||
}
|
||||
}
|
||||
isGzipped = true
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user