summaryrefslogtreecommitdiffstats
path: root/core/channel.go
diff options
context:
space:
mode:
authorVladimir Lavor <vlavor@cisco.com>2020-12-03 14:40:09 +0100
committerVladimir Lavor <vlavor@cisco.com>2020-12-03 14:40:09 +0100
commit8d3131f90f71271835e5fed91831565797894614 (patch)
treec646a6353d9bfa4712b43fd279d3380bbc668b65 /core/channel.go
parentbcf3fbd21aa22d1546bc85ffb887ae5ba557808e (diff)
Decode message context using the message type only
In order to prevent potential future issues, the method returning message based on its ID but ignoring its package was optimized. Change-Id: I12aa2b243f32f38cb3dbc7731613c7ed9fc66539 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Diffstat (limited to 'core/channel.go')
-rw-r--r--core/channel.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/channel.go b/core/channel.go
index fbb3e59..4cb5761 100644
--- a/core/channel.go
+++ b/core/channel.go
@@ -37,8 +37,8 @@ type MessageCodec interface {
EncodeMsg(msg api.Message, msgID uint16) ([]byte, error)
// DecodeMsg decodes binary-encoded data of a message into provided Message structure.
DecodeMsg(data []byte, msg api.Message) error
- // DecodeMsgContext decodes context from message data.
- DecodeMsgContext(data []byte, msg api.Message) (context uint32, err error)
+ // DecodeMsgContext decodes context from message data and type.
+ DecodeMsgContext(data []byte, msgType api.MessageType) (context uint32, err error)
}
// MessageIdentifier provides identification of generated API messages.