[spp] [PATCH 1/3] spp_vf: add sleep after disconnect detection

x-fn-spp at sl.ntt-tx.co.jp x-fn-spp at sl.ntt-tx.co.jp
Fri Jan 11 05:27:41 CET 2019


From: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>

This update is for adding sleep() to add interval to reconnect.

Interval of accepting command is reduced to fix slow response
in previous patches, but still need to add another interval to
reconnect to spp-ctl.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki at po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki at lab.ntt.co.jp>
---
 src/vf/common/command_proc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/vf/common/command_proc.c b/src/vf/common/command_proc.c
index a612061..00ecdc1 100644
--- a/src/vf/common/command_proc.c
+++ b/src/vf/common/command_proc.c
@@ -1648,11 +1648,13 @@ spp_command_proc_do(void)
 
 	msg_ret = spp_receive_message(&sock, &msgbuf);
 	if (unlikely(msg_ret <= 0)) {
-		if (likely(msg_ret == 0))
+		if (likely(msg_ret == 0)) {
+			sleep(1);
 			return SPP_RET_OK;
-		else if (unlikely(msg_ret == SPP_CONNERR_TEMPORARY))
+		} else if (unlikely(msg_ret == SPP_CONNERR_TEMPORARY)) {
+			sleep(1);
 			return SPP_RET_OK;
-		else
+		} else
 			return SPP_RET_NG;
 	}
 
-- 
2.17.1



More information about the spp mailing list