weed volume: only store compressed data if compression is effective
This commit is contained in:
@@ -88,10 +88,12 @@ func parseMultipart(r *http.Request) (
|
|||||||
}
|
}
|
||||||
isGzipped = true
|
isGzipped = true
|
||||||
} else if operation.IsGzippable(ext, mtype, data) {
|
} else if operation.IsGzippable(ext, mtype, data) {
|
||||||
if data, e = operation.GzipData(data); e != nil {
|
if compressedData, err := operation.GzipData(data); err == nil {
|
||||||
return
|
if len(data) > len(compressedData) {
|
||||||
|
data = compressedData
|
||||||
|
isGzipped = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isGzipped = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user