From 4df448ad6cdfa2e60fa0167e5f70cc1127fbd3bf Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Tue, 13 Mar 2018 13:02:39 +0100 Subject: Add API to set ControlPing msg and fail connect on unknown ID Change-Id: Idd651a29d9fc3903f52d6fe8945add3052a28b52 Signed-off-by: Ondrej Fabry --- core/request_handler.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'core/request_handler.go') 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 } -- cgit 1.2.3-korg