diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-12-22 13:58:16 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-12-22 13:58:16 -0800 |
| commit | 852ee21835682d1b6ce52b766989a8ff82ebbf80 (patch) | |
| tree | 0fadc3b70ea01c7fd6c14a8dfaf7fde34d097d07 /weed/command/filer_copy.go | |
| parent | be946c9e54db3297a68715d1789598d004b71e60 (diff) | |
| download | seaweedfs-852ee21835682d1b6ce52b766989a8ff82ebbf80.tar.xz seaweedfs-852ee21835682d1b6ce52b766989a8ff82ebbf80.zip | |
avoid .gz auto decompression
Diffstat (limited to 'weed/command/filer_copy.go')
| -rw-r--r-- | weed/command/filer_copy.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index b519afe86..0f4f96f1b 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -15,7 +15,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/util" "io" "net/http" - "path" "strconv" "time" ) @@ -165,7 +164,6 @@ func uploadFileAsOne(filerAddress, filerGrpcAddress string, urlFolder string, f // upload the file content fileName := filepath.Base(f.Name()) mimeType := detectMimeType(f) - isGzipped := isGzipped(fileName) var chunks []*filer_pb.FileChunk @@ -184,7 +182,7 @@ func uploadFileAsOne(filerAddress, filerGrpcAddress string, urlFolder string, f targetUrl := "http://" + assignResult.Url + "/" + assignResult.Fid - uploadResult, err := operation.Upload(targetUrl, fileName, f, isGzipped, mimeType, nil, "") + uploadResult, err := operation.Upload(targetUrl, fileName, f, false, mimeType, nil, "") if err != nil { fmt.Printf("upload data %v to %s: %v\n", fileName, targetUrl, err) return false @@ -318,10 +316,6 @@ func uploadFileInChunks(filerAddress, filerGrpcAddress string, urlFolder string, return true } -func isGzipped(filename string) bool { - return strings.ToLower(path.Ext(filename)) == ".gz" -} - func detectMimeType(f *os.File) string { head := make([]byte, 512) f.Seek(0, 0) |
