mirror of
https://github.com/chrislusf/seaweedfs
synced 2024-05-21 02:42:28 +02:00
fix: panic: assignment to entry in nil map on S3Sink.CreateEntry (#5406)
This commit is contained in:
parent
8b18dd940f
commit
25643cfbc6
|
@ -175,18 +175,23 @@ func (s3sink *S3Sink) CreateEntry(key string, entry *filer_pb.Entry, signatures
|
||||||
uploader.PartSize = 0
|
uploader.PartSize = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, ok := entry.Extended[s3_constants.AmzUserMetaMtime]; !ok {
|
|
||||||
|
doSaveMtime := true
|
||||||
|
if entry.Extended == nil {
|
||||||
|
entry.Extended = make(map[string][]byte)
|
||||||
|
} else if _, ok := entry.Extended[s3_constants.AmzUserMetaMtime]; ok {
|
||||||
|
doSaveMtime = false
|
||||||
|
}
|
||||||
|
if doSaveMtime {
|
||||||
entry.Extended[s3_constants.AmzUserMetaMtime] = []byte(strconv.FormatInt(entry.Attributes.Mtime, 10))
|
entry.Extended[s3_constants.AmzUserMetaMtime] = []byte(strconv.FormatInt(entry.Attributes.Mtime, 10))
|
||||||
}
|
}
|
||||||
// process tagging
|
// process tagging
|
||||||
tags := ""
|
tags := ""
|
||||||
if true {
|
for k, v := range entry.Extended {
|
||||||
for k, v := range entry.Extended {
|
if len(tags) > 0 {
|
||||||
if len(tags) > 0 {
|
tags = tags + "&"
|
||||||
tags = tags + "&"
|
|
||||||
}
|
|
||||||
tags = tags + k + "=" + string(v)
|
|
||||||
}
|
}
|
||||||
|
tags = tags + k + "=" + string(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload the file to S3.
|
// Upload the file to S3.
|
||||||
|
|
Loading…
Reference in a new issue