summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-handshake.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-06-24 07:58:51 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-06-25 03:16:36 -0700
commit29893bcba579f7e37a6ace018ffda1c8abe45550 (patch)
tree88cd08652635723569fb4401485e07a0460b43a5 /xlators/protocol/server/src/server-handshake.c
parentb8b2a9d2f49686d5056fb0ce6150cf9c54180b12 (diff)
added proper mem-types to GF_CALLOC in protocol
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875
Diffstat (limited to 'xlators/protocol/server/src/server-handshake.c')
-rw-r--r--xlators/protocol/server/src/server-handshake.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index 8ce9f6b3a..bc4d4afa2 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -537,11 +537,12 @@ server_setvolume (rpcsvc_request_t *req)
peerinfo = &req->conn->trans->peerinfo;
- ret = dict_set_static_ptr (params, "peer-info", peerinfo);
- if (ret < 0)
- gf_log (this->name, GF_LOG_DEBUG,
- "failed to set peer-info");
-
+ if (peerinfo) {
+ ret = dict_set_static_ptr (params, "peer-info", peerinfo);
+ if (ret < 0)
+ gf_log (this->name, GF_LOG_DEBUG,
+ "failed to set peer-info");
+ }
if (conf->auth_modules == NULL) {
gf_log (this->name, GF_LOG_ERROR,
"Authentication module not initialized");
@@ -553,7 +554,7 @@ server_setvolume (rpcsvc_request_t *req)
if (ret == AUTH_ACCEPT) {
gf_log (this->name, GF_LOG_INFO,
"accepted client from %s",
- peerinfo->identifier);
+ (peerinfo)?peerinfo->identifier:"");
op_ret = 0;
conn->bound_xl = xl;
ret = dict_set_str (reply, "ERROR", "Success");
@@ -563,7 +564,7 @@ server_setvolume (rpcsvc_request_t *req)
} else {
gf_log (this->name, GF_LOG_ERROR,
"Cannot authenticate client from %s",
- peerinfo->identifier);
+ (peerinfo)? peerinfo->identifier:"<>");
op_ret = -1;
op_errno = EACCES;
ret = dict_set_str (reply, "ERROR", "Authentication failed");
@@ -621,7 +622,8 @@ fail:
}
if (rsp.dict.dict_len) {
- rsp.dict.dict_val = GF_CALLOC (1, rsp.dict.dict_len, 0);
+ rsp.dict.dict_val = GF_CALLOC (1, rsp.dict.dict_len,
+ gf_server_mt_rsp_buf_t);
if (rsp.dict.dict_val) {
ret = dict_serialize (reply, rsp.dict.dict_val);
if (ret < 0) {