From 07873893ad88e961cd0736872700f2bdc746d49c Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 27 Aug 2010 03:57:53 +0000 Subject: Misleading probe message for friend Progress with probe if host already is present in the list and state is not default or request received. To test, probe from on host, on the other host, do a probe back to host1. This should now continue with probe for the first time. Second probe should return already friend msg. Signed-off-by: shishir gowda Signed-off-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-handler.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 6c99ae70b6e..9eefd89b4b1 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -530,11 +530,15 @@ glusterd_handle_cli_probe (rpcsvc_request_t *req) } if (!(ret = glusterd_friend_find_by_hostname(cli_req.hostname, &peerinfo))) { - gf_log ("glusterd", GF_LOG_NORMAL, "Probe host %s port %d" - "already a friend", cli_req.hostname, cli_req.port); - glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_FRIEND, - cli_req.hostname, cli_req.port); - goto out; + if ((peerinfo->state.state != GD_FRIEND_STATE_REQ_RCVD) + || (peerinfo->state.state != GD_FRIEND_STATE_DEFAULT)) { + + gf_log ("glusterd", GF_LOG_NORMAL, "Probe host %s port %d" + "already a friend", cli_req.hostname, cli_req.port); + glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_FRIEND, + cli_req.hostname, cli_req.port); + goto out; + } } ret = glusterd_probe_begin (req, cli_req.hostname, cli_req.port); -- cgit