aboutsummaryrefslogtreecommitdiffstats
path: root/core/channel.go
diff options
context:
space:
mode:
authorVladimir Lavor <vlavor@cisco.com>2020-12-01 13:57:29 +0100
committerVladimir Lavor <vlavor@cisco.com>2020-12-03 10:14:12 +0100
commitbcf3fbd21aa22d1546bc85ffb887ae5ba557808e (patch)
tree60668ecb3d0721bf33cfa1b37736a494f675ec4b /core/channel.go
parent2b743eede78b6fed115421716888f80088edefdb (diff)
Fixed incorrect message error in the stream API
The message package is passed to the stream object and used to evaluate correct reply message type Change-Id: I2c9844d6447d024af1693205efd5721e2f89f22d Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Diffstat (limited to 'core/channel.go')
-rw-r--r--core/channel.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/channel.go b/core/channel.go
index 28d0710..fbb3e59 100644
--- a/core/channel.go
+++ b/core/channel.go
@@ -45,8 +45,10 @@ type MessageCodec interface {
type MessageIdentifier interface {
// GetMessageID returns message identifier of given API message.
GetMessageID(msg api.Message) (uint16, error)
+ // GetMessagePath returns path for the given message
+ GetMessagePath(msg api.Message) string
// LookupByID looks up message name and crc by ID
- LookupByID(msgID uint16) (api.Message, error)
+ LookupByID(path string, msgID uint16) (api.Message, error)
}
// vppRequest is a request that will be sent to VPP.
@@ -329,7 +331,8 @@ func (ch *Channel) processReply(reply *vppReply, expSeqNum uint16, msg api.Messa
if reply.msgID != expMsgID {
var msgNameCrc string
- if replyMsg, err := ch.msgIdentifier.LookupByID(reply.msgID); err != nil {
+ pkgPath := ch.msgIdentifier.GetMessagePath(msg)
+ if replyMsg, err := ch.msgIdentifier.LookupByID(pkgPath, reply.msgID); err != nil {
msgNameCrc = err.Error()
} else {
msgNameCrc = getMsgNameWithCrc(replyMsg)