mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-07-17 02:28:00 +08:00
rename UnCompressData to DecompressData
This commit is contained in:
parent
97239ce6f1
commit
3080c197e3
@ -49,7 +49,7 @@ func main() {
|
|||||||
|
|
||||||
data := n.Data
|
data := n.Data
|
||||||
if n.IsCompressed() {
|
if n.IsCompressed() {
|
||||||
if data, err = util2.UnCompressData(data); err != nil {
|
if data, err = util2.DecompressData(data); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ func (s ChunkList) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|||||||
func LoadChunkManifest(buffer []byte, isCompressed bool) (*ChunkManifest, error) {
|
func LoadChunkManifest(buffer []byte, isCompressed bool) (*ChunkManifest, error) {
|
||||||
if isCompressed {
|
if isCompressed {
|
||||||
var err error
|
var err error
|
||||||
if buffer, err = util.UnCompressData(buffer); err != nil {
|
if buffer, err = util.DecompressData(buffer); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, i
|
|||||||
}
|
}
|
||||||
} else if isInputGzipped {
|
} else if isInputGzipped {
|
||||||
// just to get the clear data length
|
// just to get the clear data length
|
||||||
clearData, err := util.UnCompressData(data)
|
clearData, err := util.DecompressData(data)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
clearDataLen = len(clearData)
|
clearDataLen = len(clearData)
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
if n.IsCompressed() {
|
if n.IsCompressed() {
|
||||||
if strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
|
if strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
|
||||||
if _, _, _, shouldResize := shouldResizeImages(ext, r); shouldResize {
|
if _, _, _, shouldResize := shouldResizeImages(ext, r); shouldResize {
|
||||||
if n.Data, err = util.UnCompressData(n.Data); err != nil {
|
if n.Data, err = util.DecompressData(n.Data); err != nil {
|
||||||
glog.V(0).Infoln("ungzip error:", err, r.URL.Path)
|
glog.V(0).Infoln("ungzip error:", err, r.URL.Path)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -155,7 +155,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if n.Data, err = util.UnCompressData(n.Data); err != nil {
|
if n.Data, err = util.DecompressData(n.Data); err != nil {
|
||||||
glog.V(0).Infoln("ungzip error:", err, r.URL.Path)
|
glog.V(0).Infoln("ungzip error:", err, r.URL.Path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ func ParseUpload(r *http.Request, sizeLimit int64) (pu *ParsedUpload, e error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if pu.IsGzipped {
|
if pu.IsGzipped {
|
||||||
if unzipped, e := util.UnCompressData(pu.Data); e == nil {
|
if unzipped, e := util.DecompressData(pu.Data); e == nil {
|
||||||
pu.OriginalDataSize = len(unzipped)
|
pu.OriginalDataSize = len(unzipped)
|
||||||
pu.UncompressedData = unzipped
|
pu.UncompressedData = unzipped
|
||||||
// println("ungzipped data size", len(unzipped))
|
// println("ungzipped data size", len(unzipped))
|
||||||
|
@ -26,7 +26,7 @@ func GzipData(input []byte) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
return buf.Bytes(), nil
|
return buf.Bytes(), nil
|
||||||
}
|
}
|
||||||
func UnCompressData(input []byte) ([]byte, error) {
|
func DecompressData(input []byte) ([]byte, error) {
|
||||||
if IsGzippedContent(input) {
|
if IsGzippedContent(input) {
|
||||||
return ungzipData(input)
|
return ungzipData(input)
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ func readEncryptedUrl(fileUrl string, cipherKey []byte, isContentCompressed bool
|
|||||||
return fmt.Errorf("decrypt %s: %v", fileUrl, err)
|
return fmt.Errorf("decrypt %s: %v", fileUrl, err)
|
||||||
}
|
}
|
||||||
if isContentCompressed {
|
if isContentCompressed {
|
||||||
decryptedData, err = UnCompressData(decryptedData)
|
decryptedData, err = DecompressData(decryptedData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unzip decrypt %s: %v", fileUrl, err)
|
return fmt.Errorf("unzip decrypt %s: %v", fileUrl, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user