diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-06-20 08:01:00 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-06-20 08:01:00 -0700 |
| commit | a735fd767cbda1fa17fd2aeb963707c8b18adc1d (patch) | |
| tree | f87fc83c8e177218ce70aa256b35b6d389b056ab | |
| parent | ca3516ac6d9cc266b4953d96360c0c733e7244a3 (diff) | |
| download | seaweedfs-a735fd767cbda1fa17fd2aeb963707c8b18adc1d.tar.xz seaweedfs-a735fd767cbda1fa17fd2aeb963707c8b18adc1d.zip | |
adjust uncompress data
| -rw-r--r-- | weed/util/compression.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/weed/util/compression.go b/weed/util/compression.go index f6315ebc2..ff5e3ad3f 100644 --- a/weed/util/compression.go +++ b/weed/util/compression.go @@ -4,6 +4,7 @@ import ( "bytes" "compress/flate" "compress/gzip" + "fmt" "io/ioutil" "strings" @@ -29,18 +30,7 @@ func UnCompressData(input []byte) ([]byte, error) { if IsGzippedContent(input) { return ungzipData(input) } - -} - -func ungzipData(input []byte) ([]byte, error) { - buf := bytes.NewBuffer(input) - r, _ := gzip.NewReader(buf) - defer r.Close() - output, err := ioutil.ReadAll(r) - if err != nil { - glog.V(2).Infoln("error uncompressing data:", err) - } - return output, err + return nil, fmt.Errorf("unsupported compression") } func ungzipData(input []byte) ([]byte, error) { |
