Skip to content

Commit

Permalink
fix metadatacopy to actually copy the payload and not reference it
Browse files Browse the repository at this point in the history
  • Loading branch information
arnecls committed Aug 15, 2017
1 parent bf4c10a commit 68e98ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion format/metadatacopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ func (format *MetadataCopy) Configure(conf core.PluginConfigReader) {
func (format *MetadataCopy) ApplyFormatter(msg *core.Message) error {
meta := msg.GetMetadata()
data := format.GetAppliedContent(msg)
pool := core.MessageDataPool

for _, key := range format.metaDataKeys {
meta.SetValue(key, data)
bufferCopy := pool.Get(len(data))
copy(bufferCopy, data)
meta.SetValue(key, bufferCopy)
}
return nil
}

0 comments on commit 68e98ee

Please sign in to comment.