refactoring
some previous chunk etag was using md5, which should be wrong.
This commit is contained in:
@@ -119,17 +119,7 @@ func (fs *FilerServer) doAutoChunk(ctx context.Context, w http.ResponseWriter, r
|
||||
}
|
||||
|
||||
// Save to chunk manifest structure
|
||||
fileChunks = append(fileChunks,
|
||||
&filer_pb.FileChunk{
|
||||
FileId: fileId,
|
||||
Offset: chunkOffset,
|
||||
Size: uint64(uploadResult.Size),
|
||||
Mtime: time.Now().UnixNano(),
|
||||
ETag: uploadResult.ETag,
|
||||
CipherKey: uploadResult.CipherKey,
|
||||
IsGzipped: uploadResult.Gzip > 0,
|
||||
},
|
||||
)
|
||||
fileChunks = append(fileChunks, uploadResult.ToPbFileChunk(fileId, chunkOffset))
|
||||
|
||||
glog.V(4).Infof("uploaded %s chunk %d to %s [%d,%d) of %d", fileName, len(fileChunks), fileId, chunkOffset, chunkOffset+int64(uploadResult.Size), contentLength)
|
||||
|
||||
|
||||
@@ -46,17 +46,7 @@ func (fs *FilerServer) encrypt(ctx context.Context, w http.ResponseWriter, r *ht
|
||||
}
|
||||
|
||||
// Save to chunk manifest structure
|
||||
fileChunks := []*filer_pb.FileChunk{
|
||||
{
|
||||
FileId: fileId,
|
||||
Offset: 0,
|
||||
Size: uint64(uploadResult.Size),
|
||||
Mtime: time.Now().UnixNano(),
|
||||
ETag: uploadResult.Md5,
|
||||
CipherKey: uploadResult.CipherKey,
|
||||
IsGzipped: uploadResult.Gzip > 0,
|
||||
},
|
||||
}
|
||||
fileChunks := []*filer_pb.FileChunk{uploadResult.ToPbFileChunk(fileId, 0)}
|
||||
|
||||
// fmt.Printf("uploaded: %+v\n", uploadResult)
|
||||
|
||||
|
||||
@@ -418,17 +418,7 @@ func (f *WebDavFile) Write(buf []byte) (int, error) {
|
||||
return 0, fmt.Errorf("upload result: %v", uploadResult.Error)
|
||||
}
|
||||
|
||||
chunk := &filer_pb.FileChunk{
|
||||
FileId: fileId,
|
||||
Offset: f.off,
|
||||
Size: uint64(len(buf)),
|
||||
Mtime: time.Now().UnixNano(),
|
||||
ETag: uploadResult.ETag,
|
||||
CipherKey: uploadResult.CipherKey,
|
||||
IsGzipped: uploadResult.Gzip > 0,
|
||||
}
|
||||
|
||||
f.entry.Chunks = append(f.entry.Chunks, chunk)
|
||||
f.entry.Chunks = append(f.entry.Chunks, uploadResult.ToPbFileChunk(fileId, f.off))
|
||||
|
||||
err = f.fs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||
f.entry.Attributes.Mtime = time.Now().Unix()
|
||||
|
||||
Reference in New Issue
Block a user