mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 19:19:24 +08:00
refactoring
some previous chunk etag was using md5, which should be wrong.
This commit is contained in:
@@ -14,8 +14,10 @@ import (
|
||||
"net/textproto"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/chrislusf/seaweedfs/weed/security"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
)
|
||||
@@ -31,6 +33,18 @@ type UploadResult struct {
|
||||
Md5 string `json:"md5,omitempty"`
|
||||
}
|
||||
|
||||
func (uploadResult *UploadResult) ToPbFileChunk(fileId string, offset int64) *filer_pb.FileChunk {
|
||||
return &filer_pb.FileChunk{
|
||||
FileId: fileId,
|
||||
Offset: offset,
|
||||
Size: uint64(uploadResult.Size),
|
||||
Mtime: time.Now().UnixNano(),
|
||||
ETag: uploadResult.ETag,
|
||||
CipherKey: uploadResult.CipherKey,
|
||||
IsGzipped: uploadResult.Gzip > 0,
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
client *http.Client
|
||||
)
|
||||
|
Reference in New Issue
Block a user