diff options
author | Amar Tumballi <amar@gluster.com> | 2010-07-23 03:13:48 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-23 04:28:53 -0700 |
commit | dbab7f87b6fbcc4d1f518e6f98101331df51ce4a (patch) | |
tree | b22ee90a8823f98f99d178185756ccac8a83e15e /xlators/protocol/client/src/client.c | |
parent | 9c2753d1bee735cb74968106c7ce8ca1460504c6 (diff) |
client protocol should send the fops only after handshake
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1195 (crash in protocol server due to unauthenticated fop request..)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1195
Diffstat (limited to 'xlators/protocol/client/src/client.c')
-rw-r--r-- | xlators/protocol/client/src/client.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 80a2d4d3461..97d9644342e 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -53,8 +53,19 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, int count = 0; char new_iobref = 0, start_ping = 0; + if (!this || !prog || !frame) + goto out; + conf = this->private; + /* If 'setvolume' is not successful, we should not send frames to + server, mean time we should be able to send 'DUMP' and 'SETVOLUME' + call itself even if its not connected */ + if (!(conf->connected || + ((prog->prognum == GLUSTER_DUMP_PROGRAM) || + ((prog->prognum == GLUSTER_HNDSK_PROGRAM) && (procnum == GF_HNDSK_SETVOLUME))))) + goto out; + iobuf = iobuf_get (this->ctx->iobuf_pool); if (!iobuf) { goto out; @@ -102,11 +113,11 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, ret = 0; out: - if (new_iobref) { + if (new_iobref) iobref_unref (iobref); - } - iobuf_unref (iobuf); + if (iobuf) + iobuf_unref (iobuf); return ret; } |