Browse Source

weed volume: only store compressed data if compression is effective

pull/922/head
Chris Lu 6 years ago
parent
commit
94302935b2
  1. 8
      weed/storage/needle_parse_multipart.go

8
weed/storage/needle_parse_multipart.go

@ -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…
Cancel
Save