diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-06-19 22:45:27 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-06-19 22:45:27 -0700 |
| commit | e912fd15e32179ca532c23011ce7bc9186586ba4 (patch) | |
| tree | 4e5065c2b0df4ff4420e434a9c464b88e33072fb /weed/storage | |
| parent | 16fe132a20b859a57ba51cbb8824dbae69513a55 (diff) | |
| download | seaweedfs-e912fd15e32179ca532c23011ce7bc9186586ba4.tar.xz seaweedfs-e912fd15e32179ca532c23011ce7bc9186586ba4.zip | |
renaming
Diffstat (limited to 'weed/storage')
| -rw-r--r-- | weed/storage/needle/needle.go | 2 | ||||
| -rw-r--r-- | weed/storage/needle/needle_parse_upload.go | 4 | ||||
| -rw-r--r-- | weed/storage/needle/needle_read_write.go | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/weed/storage/needle/needle.go b/weed/storage/needle/needle.go index d3969e868..7d02758d6 100644 --- a/weed/storage/needle/needle.go +++ b/weed/storage/needle/needle.go @@ -81,7 +81,7 @@ func CreateNeedleFromRequest(r *http.Request, fixJpgOrientation bool, sizeLimit } } if pu.IsGzipped { - n.SetGzipped() + n.SetIsCompressed() } if n.LastModified == 0 { n.LastModified = uint64(time.Now().Unix()) diff --git a/weed/storage/needle/needle_parse_upload.go b/weed/storage/needle/needle_parse_upload.go index 9873c2412..c1fb10713 100644 --- a/weed/storage/needle/needle_parse_upload.go +++ b/weed/storage/needle/needle_parse_upload.go @@ -51,7 +51,7 @@ func ParseUpload(r *http.Request, sizeLimit int64) (pu *ParsedUpload, e error) { pu.OriginalDataSize = len(pu.Data) pu.UncompressedData = pu.Data - // println("received data", len(pu.Data), "isGzipped", pu.IsGzipped, "mime", pu.MimeType, "name", pu.FileName) + // println("received data", len(pu.Data), "isGzipped", pu.IsCompressed, "mime", pu.MimeType, "name", pu.FileName) if pu.MimeType == "" { pu.MimeType = http.DetectContentType(pu.Data) // println("detected mimetype to", pu.MimeType) @@ -60,7 +60,7 @@ func ParseUpload(r *http.Request, sizeLimit int64) (pu *ParsedUpload, e error) { } } if pu.IsGzipped { - if unzipped, e := util.UnGzipData(pu.Data); e == nil { + if unzipped, e := util.UnCompressData(pu.Data); e == nil { pu.OriginalDataSize = len(unzipped) pu.UncompressedData = unzipped // println("ungzipped data size", len(unzipped)) diff --git a/weed/storage/needle/needle_read_write.go b/weed/storage/needle/needle_read_write.go index e89e253cd..9702cf939 100644 --- a/weed/storage/needle/needle_read_write.go +++ b/weed/storage/needle/needle_read_write.go @@ -13,7 +13,7 @@ import ( ) const ( - FlagGzip = 0x01 + FlagIsCompressed = 0x01 FlagHasName = 0x02 FlagHasMime = 0x04 FlagHasLastModifiedDate = 0x08 @@ -343,11 +343,11 @@ func (n *Needle) ReadNeedleBodyBytes(needleBody []byte, version Version) (err er return } -func (n *Needle) IsGzipped() bool { - return n.Flags&FlagGzip > 0 +func (n *Needle) IsCompressed() bool { + return n.Flags&FlagIsCompressed > 0 } -func (n *Needle) SetGzipped() { - n.Flags = n.Flags | FlagGzip +func (n *Needle) SetIsCompressed() { + n.Flags = n.Flags | FlagIsCompressed } func (n *Needle) HasName() bool { return n.Flags&FlagHasName > 0 |
