diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-06-09 05:09:01 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-11 07:51:27 -0700 |
commit | 181ab58c6adeda6f99eb9330ed8ce720ab0f2818 (patch) | |
tree | 5928997bc43e943710b56f1dc463c5c6c588ff07 /xlators/protocol/server/src/server-protocol.c | |
parent | 2943c77d88eccc195c59ded0aa9a377fcef906d9 (diff) |
Implemented LOG MOP in server-protocol.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/protocol/server/src/server-protocol.c')
-rw-r--r-- | xlators/protocol/server/src/server-protocol.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 47bc2ae961c..31fc16bd81b 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -7230,6 +7230,33 @@ mop_ping (call_frame_t *frame, xlator_t *bound_xl, return 0; } + + +int +mop_log (call_frame_t *frame, xlator_t *bound_xl, + gf_hdr_common_t *hdr, size_t hdrlen, + struct iobuf *iobuf) +{ + gf_mop_log_req_t * req = NULL; + char * msg = NULL; + uint32_t msglen = 0; + + transport_t * trans = NULL; + + trans = TRANSPORT_FROM_FRAME (frame); + + req = gf_param (hdr); + msglen = ntoh32 (req->msglen); + + if (msglen) + msg = req->msg; + + gf_log_from_client (msg, trans->peerinfo.identifier); + + return 0; +} + + /* * unknown_op_cbk - This function is called when a opcode for unknown * type is called. Helps to keep the backward/forward @@ -7405,6 +7432,7 @@ static gf_op_t gf_mops[] = { [GF_MOP_STATS] = mop_stats, [GF_MOP_GETSPEC] = mop_getspec, [GF_MOP_PING] = mop_ping, + [GF_MOP_LOG] = mop_log, }; static gf_op_t gf_cbks[] = { |