summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket/src/socket.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-07-29 16:36:27 +0530
committerAnand Avati <avati@gluster.com>2011-07-31 23:15:32 -0700
commitdf0a72d9c118c2a1146f2787eee6d5f0a58853f0 (patch)
treefc6eb998d3e3965610aef473a1f6b3e46cf2fb7c /rpc/rpc-transport/socket/src/socket.c
parent76acac485b9f06f36d145b4c31fa6f4da3c70f52 (diff)
Variable IOBUF: Use variable iobuf for cli/glusterd/glusterfsd(mgmt)
By using variable iobufs, xfer data size is no more limited to 128K (default). This helps in scaling. Change-Id: Iab453db9223d887306d150cd6fe0b1eae9c422cc BUG: 2472 Reviewed-on: http://review.gluster.com/13 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.c')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 51d51bc9e..2b6aae081 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -1481,14 +1481,6 @@ __socket_proto_state_machine (rpc_transport_t *this,
switch (priv->incoming.record_state) {
case SP_STATE_NADA:
- iobuf = iobuf_get (this->ctx->iobuf_pool);
- if (!iobuf) {
- ret = -ENOMEM;
- goto out;
- }
-
- priv->incoming.iobuf = iobuf;
- priv->incoming.iobuf_size = 0;
priv->incoming.total_bytes_read = 0;
priv->incoming.payload_vector.iov_len = 0;
@@ -1496,7 +1488,6 @@ __socket_proto_state_machine (rpc_transport_t *this,
priv->incoming.pending_vector->iov_base =
&priv->incoming.fraghdr;
- priv->incoming.frag.fragcurrent = iobuf_ptr (iobuf);
priv->incoming.pending_vector->iov_len =
sizeof (priv->incoming.fraghdr);
@@ -1540,6 +1531,17 @@ __socket_proto_state_machine (rpc_transport_t *this,
priv->incoming.record_state = SP_STATE_READING_FRAG;
priv->incoming.total_bytes_read
+= RPC_FRAGSIZE(priv->incoming.fraghdr);
+ iobuf = iobuf_get2 (this->ctx->iobuf_pool,
+ priv->incoming.total_bytes_read +
+ sizeof (priv->incoming.fraghdr));
+ if (!iobuf) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ priv->incoming.iobuf = iobuf;
+ priv->incoming.iobuf_size = 0;
+ priv->incoming.frag.fragcurrent = iobuf_ptr (iobuf);
/* fall through */
case SP_STATE_READING_FRAG: