summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-08-04 04:45:25 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-06 03:37:20 -0700
commitb04d963e91f8b3c72343e1043d6ed8c68699c4fe (patch)
tree42ae4cadaa016efd7f11ea0745d457ee79d3aaf3 /rpc/rpc-transport/socket
parent21e4580c24b3e4a1270ad482e1d905afffb00fba (diff)
rpc: changes to glusterfs programs that can take an optional payload argument.
- The existing interface required the transport to separate the procedure header and procedure payload into two different buffers. Making this separation can prove cumbersome for transports like rdma wherein the header and payload can be received in a single buffer (For eg., header and payload of write fop sent as inline msg using rdma-send). This patch delegates the responsiblity of separating out header and payload to programs. Signed-off-by: Raghavendra G <raghavendra@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 'rpc/rpc-transport/socket')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index baeee735bb8..b017462a507 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -1057,6 +1057,10 @@ __socket_read_vectored_reply (rpc_transport_t *this)
&& (RPC_LASTFRAG (priv->incoming.fraghdr)))) {
priv->incoming.frag.call_body.reply.status_state
= SP_STATE_ACCEPTED_REPLY_INIT;
+ priv->incoming.payload_vector.iov_len
+ = (unsigned long)priv->incoming.frag.fragcurrent
+ - (unsigned long)
+ priv->incoming.payload_vector.iov_base;
}
break;
}
@@ -1230,6 +1234,7 @@ __socket_proto_state_machine (rpc_transport_t *this,
priv->incoming.iobuf = iobuf;
priv->incoming.iobuf_size = 0;
+ priv->incoming.total_bytes_read = 0;
priv->incoming.payload_vector.iov_len = 0;
priv->incoming.pending_vector = priv->incoming.vector;