summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-10-12 02:21:16 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-12 01:39:49 -0700
commitf637330995eab92a1d0b9f4ad9c43acfaad35037 (patch)
tree4ba5d614dc3aa64431dd78f65fb8ad258325273a
parent15c9f6789fe41afdda12052c9ce6d538e0c2f5e6 (diff)
rpcsvc: calculate dump response length instead of hard coding it.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Vijay Bellur <vijay@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
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index e14313fe7..daf1298bb 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -2132,10 +2132,11 @@ static int
rpcsvc_dump (rpcsvc_request_t *req)
{
char rsp_buf[8 * 1024] = {0,};
- gf_dump_rsp rsp = {0,};
- struct iovec iov = {0,};
- int op_errno = EINVAL;
- int ret = -1;
+ gf_dump_rsp rsp = {0,};
+ struct iovec iov = {0,};
+ int op_errno = EINVAL;
+ int ret = -1;
+ uint32_t dump_rsp_len = 0;
if (!req)
goto fail;
@@ -2150,8 +2151,11 @@ fail:
rsp.op_errno = gf_errno_to_error (op_errno);
rsp.op_ret = ret;
+ dump_rsp_len = xdr_sizeof ((xdrproc_t) xdr_gf_dump_rsp,
+ &rsp);
+
iov.iov_base = rsp_buf;
- iov.iov_len = (8 * 1024);
+ iov.iov_len = dump_rsp_len;
ret = xdr_serialize_dump_rsp (iov, &rsp);
if (ret < 0) {