diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-08 08:12:00 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-08 08:12:00 -0700 |
| commit | ec2eb8bc4804f9b880f256a55e3cbfc0923b6a29 (patch) | |
| tree | e0484d192fd361f1a0039492bcfffd75de1567db /weed/filer2/entry_codec.go | |
| parent | 2d7d4b1006a8cd1f7af6244672541e9ac16bfac9 (diff) | |
| download | seaweedfs-ec2eb8bc4804f9b880f256a55e3cbfc0923b6a29.tar.xz seaweedfs-ec2eb8bc4804f9b880f256a55e3cbfc0923b6a29.zip | |
add If-None-Match and If-Modified-Since
fix https://github.com/chrislusf/seaweedfs/issues/1269
Diffstat (limited to 'weed/filer2/entry_codec.go')
| -rw-r--r-- | weed/filer2/entry_codec.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/filer2/entry_codec.go b/weed/filer2/entry_codec.go index 3a2dc6134..47c911011 100644 --- a/weed/filer2/entry_codec.go +++ b/weed/filer2/entry_codec.go @@ -52,6 +52,7 @@ func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes { UserName: entry.Attr.UserName, GroupName: entry.Attr.GroupNames, SymlinkTarget: entry.Attr.SymlinkTarget, + Md5: entry.Attr.Md5, } } @@ -71,6 +72,7 @@ func PbToEntryAttribute(attr *filer_pb.FuseAttributes) Attr { t.UserName = attr.UserName t.GroupNames = attr.GroupName t.SymlinkTarget = attr.SymlinkTarget + t.Md5 = attr.Md5 return t } @@ -93,6 +95,10 @@ func EqualEntry(a, b *Entry) bool { return false } + if !bytes.Equal(a.Md5, b.Md5) { + return false + } + for i := 0; i < len(a.Chunks); i++ { if !proto.Equal(a.Chunks[i], b.Chunks[i]) { return false |
