Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/5] primary: chage to return msg of exit command
Date: Thu, 25 Oct 2018 14:20:19 +0900	[thread overview]
Message-ID: <20181025052023.17190-2-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20181025052023.17190-1-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

This patch is to fix error of receiving data of PrimaryProc in spp-ctl.
Spp_primary returns no message after exit command while spp-ctl expects
to get any of message as a result. To fix, change to return empty
message.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/primary/main.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/primary/main.c b/src/primary/main.c
index 33f4143..d991bca 100644
--- a/src/primary/main.c
+++ b/src/primary/main.c
@@ -383,6 +383,7 @@ main(int argc, char *argv[])
 	int sock = SOCK_RESET;
 	int connected = 0;
 	char str[MSG_SIZE];
+	int flg_exit;  // used as res of parse_command() to exit if -1
 	int ret;
 
 	/* Register signals */
@@ -413,13 +414,14 @@ main(int argc, char *argv[])
 
 		RTE_LOG(DEBUG, APP, "Received string: %s\n", str);
 
-		ret = parse_command(str);
-		if (ret < 0)
-			break;
+		flg_exit = parse_command(str);
 
 		/* Send the message back to client */
 		ret = do_send(&connected, &sock, str);
-		if (ret < 0)
+
+		if (flg_exit < 0)  /* terminate process if exit is called */
+			break;
+		else if (ret < 0)
 			continue;
 	}
 
-- 
2.7.4

  reply	other threads:[~2018-10-25  5:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25  5:20 [spp] [PATCH 0/5] Add exit command support for spp_primary ogawa.yasufumi
2018-10-25  5:20 ` ogawa.yasufumi [this message]
2018-10-25  5:20 ` [spp] [PATCH 2/5] spp-ctl: add exit cmd " ogawa.yasufumi
2018-10-25  5:20 ` [spp] [PATCH 3/5] controller: change pri exit cmd to call REST API ogawa.yasufumi
2018-10-25  5:20 ` [spp] [PATCH 4/5] docs: add DELETE method for exiting spp_primary ogawa.yasufumi
2018-10-25  5:20 ` [spp] [PATCH 5/5] docs: remove exit from pri command ogawa.yasufumi
2018-11-09  3:21 ` [spp] [PATCH v2 0/5] Add exit command support for spp_primary ogawa.yasufumi
2018-11-09  3:21   ` [spp] [PATCH v2 1/5] primary: chage to return msg of exit command ogawa.yasufumi
2018-11-09  3:21   ` [spp] [PATCH v2 2/5] spp-ctl: add exit cmd support for spp_primary ogawa.yasufumi
2018-11-09  3:21   ` [spp] [PATCH v2 3/5] controller: change pri exit cmd to call REST API ogawa.yasufumi
2018-11-09  3:21   ` [spp] [PATCH v2 4/5] docs: add DELETE method for exiting spp_primary ogawa.yasufumi
2018-11-09  3:21   ` [spp] [PATCH v2 5/5] docs: remove exit from pri command ogawa.yasufumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181025052023.17190-2-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).