aboutsummaryrefslogtreecommitdiffstats
path: root/core/request_handler.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2018-03-13 13:02:39 +0100
committerOndrej Fabry <ofabry@cisco.com>2018-03-13 13:02:39 +0100
commit4df448ad6cdfa2e60fa0167e5f70cc1127fbd3bf (patch)
tree3f203ea2d5395c814072c3507d151af03f758f3a /core/request_handler.go
parent2406041faa197799c7715f815cbd391a5c0e9ad3 (diff)
Add API to set ControlPing msg and fail connect on unknown ID
Change-Id: Idd651a29d9fc3903f52d6fe8945add3052a28b52 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'core/request_handler.go')
-rw-r--r--core/request_handler.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/request_handler.go b/core/request_handler.go
index c1683d3..dc02ee7 100644
--- a/core/request_handler.go
+++ b/core/request_handler.go
@@ -22,7 +22,6 @@ import (
logger "github.com/sirupsen/logrus"
"git.fd.io/govpp.git/api"
- "git.fd.io/govpp.git/core/bin_api/vpe"
)
// watchRequests watches for requests on the request API channel and forwards them as messages to VPP.
@@ -62,7 +61,7 @@ func (c *Connection) processRequest(ch *api.Channel, chMeta *channelMetadata, re
log.WithFields(logger.Fields{
"msg_name": req.Message.GetMessageName(),
"msg_crc": req.Message.GetCrcString(),
- }).Error(err)
+ }).Error(error)
sendReply(ch, &api.VppReply{Error: error})
return error
}
@@ -98,8 +97,7 @@ func (c *Connection) processRequest(ch *api.Channel, chMeta *channelMetadata, re
if req.Multipart {
// send a control ping to determine end of the multipart response
- ping := &vpe.ControlPing{}
- pingData, _ := c.codec.EncodeMsg(ping, c.pingReqID)
+ pingData, _ := c.codec.EncodeMsg(msgControlPing, c.pingReqID)
log.WithFields(logger.Fields{
"context": chMeta.id,
@@ -205,7 +203,7 @@ func (c *Connection) messageNameToID(msgName string, msgCrc string) (uint16, err
log.WithFields(logger.Fields{
"msg_name": msgName,
"msg_crc": msgCrc,
- }).Errorf("unable to retrieve message ID: %v", err)
+ }).Error(error)
return id, error
}