summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorAnand V. Avati <avati@amp.gluster.com>2009-04-13 15:41:01 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-04-13 15:45:42 +0530
commit3093ff0b125c520fdac3db627af708f495c9a47e (patch)
tree5aa3b39a417d7577151d3f9c9503ea926d43c3db /xlators/protocol
parenta0bb8a02cd334aeda02e6146ea541a7dae4223d5 (diff)
client_readv_cbk - when op_ret is 0, iobuf comes NULL from transport, handles this case
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-protocol.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index ce4fca95b..f28466f83 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -4931,12 +4931,14 @@ client_readv_cbk (call_frame_t *frame,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret != -1) {
+ iobref = iobref_new ();
gf_stat_to_stat (&rsp->stat, &stbuf);
- vector.iov_base = iobuf->ptr;
vector.iov_len = op_ret;
- iobref = iobref_new ();
- iobref_add (iobref, iobuf);
+ if (op_ret > 0) {
+ vector.iov_base = iobuf->ptr;
+ iobref_add (iobref, iobuf);
+ }
}
STACK_UNWIND (frame, op_ret, op_errno, &vector, 1, &stbuf, iobref);