summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-11-07 00:07:12 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-01-17 06:00:39 +0000
commit75b063d76d78b5d1e0e53a1be37dc5ad9200f7b2 (patch)
treeae9149d96a2f850c2128de0328e13634fec09a5e /xlators/protocol/client/src
parente3a191a0d3ea0706f4827ebdb6e5161623f2c5f1 (diff)
rpc/*: auth-header changes
Introduce another authentication header which can now send more data. This is useful because this data can be common for all the fops, and we don't need to change all the signatures. As part of this, made rpc-clnt.c little more modular to support multiple authentication structures. stack.h changes are placeholder for the ctime etc, can be moved later based on need. updates #384 Change-Id: I6111c13cfd2ec92e2b4e9295896bf62a8a33b2c7 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src')
-rw-r--r--xlators/protocol/client/src/client-handshake.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 68ea20ffed7..2d779fa39b7 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -20,6 +20,7 @@
#include "portmap-xdr.h"
#include "rpc-common-xdr.h"
#include "client-messages.h"
+#include "xdr-rpc.h"
#define CLIENT_REOPEN_MAX_ATTEMPTS 1024
extern rpc_clnt_prog_t clnt3_3_fop_prog;
@@ -1482,35 +1483,39 @@ select_server_supported_programs (xlator_t *this, gf_prog_detail *prog)
while (trav) {
/* Select 'programs' */
if ((clnt3_3_fop_prog.prognum == trav->prognum) &&
- (clnt3_3_fop_prog.progver == trav->progver)) {
+ (clnt3_3_fop_prog.progver == trav->progver) &&
+ !conf->fops) {
conf->fops = &clnt3_3_fop_prog;
- gf_msg (this->name, GF_LOG_INFO, 0,
- PC_MSG_VERSION_INFO, "Using Program %s, "
- "Num (%"PRId64"), Version (%"PRId64")",
- trav->progname, trav->prognum, trav->progver);
+ if (conf->rpc)
+ conf->rpc->auth_value = AUTH_GLUSTERFS_v2;
ret = 0;
}
if ((clnt4_0_fop_prog.prognum == trav->prognum) &&
(clnt4_0_fop_prog.progver == trav->progver)) {
conf->fops = &clnt4_0_fop_prog;
- gf_msg (this->name, GF_LOG_INFO, 0,
- PC_MSG_VERSION_INFO, "Using Program %s,"
- " Num (%"PRId64"), Version (%"PRId64")",
- trav->progname, trav->prognum, trav->progver);
+ if (conf->rpc)
+ conf->rpc->auth_value = AUTH_GLUSTERFS_v3;
ret = 0;
/* this is latest program, lets use it */
goto out;
}
if (ret) {
- gf_msg_trace (this->name, 0,
+ gf_msg_debug (this->name, 0,
"%s (%"PRId64") not supported",
trav->progname, trav->progver);
}
trav = trav->next;
}
+ if (!ret)
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ PC_MSG_VERSION_INFO, "Using Program %s,"
+ " Num (%d), Version (%d)",
+ conf->fops->progname, conf->fops->prognum,
+ conf->fops->progver);
+
out:
return ret;
}