[sheepdog] [PATCH] gateway: fix wait_forward_request()

Liu Yuan namei.unix at gmail.com
Wed Feb 6 05:56:21 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

We should directly err-return because wi->nr_sent isn't 0 or we'll wrongly goto
again at finish_write.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/gateway.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sheep/gateway.c b/sheep/gateway.c
index 40eb56c..04aa480 100644
--- a/sheep/gateway.c
+++ b/sheep/gateway.c
@@ -177,8 +177,7 @@ again:
 		for (i = 0; i < nr_sent; i++)
 			sheep_del_sockfd(wi->ent[i].nid, wi->ent[i].sfd);
 
-		err_ret = SD_RES_NETWORK_ERROR;
-		goto finish_write;
+		return SD_RES_NETWORK_ERROR;
 	}
 
 	nr_sent = wi->nr_sent;
-- 
1.7.9.5




More information about the sheepdog mailing list