summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket/src/socket.h
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2012-06-05 13:45:39 -0700
committerAnand Avati <avati@redhat.com>2012-06-06 11:41:40 -0700
commit497532ef7e5c4361ac6c2c76fe5f2d209b986953 (patch)
tree43b3e622e3f3b3ed2557b9740ae467e585ba951f /rpc/rpc-transport/socket/src/socket.h
parent990bc3991a0a998dc74d43250fed40ad1f72e849 (diff)
rpc-transport/socket: fix the state machine for XDATA reading
The socket state machine was broken for reading XDATA on the server. This code was structured such that when there was a partial read in a particular state, some variables would remain uninitialized in the next 'run' of the state machine. Also did some re-org of the state machine with two more states to make the code more readable and similar in state-breakup pattern to the other states. Change-Id: Ia32c78d4b9567bb08c6df8dc9fd6f05749d312a4 BUG: 829062 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3524 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.h')
-rw-r--r--rpc/rpc-transport/socket/src/socket.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index 6d6802a541f..0304f1db1eb 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -72,6 +72,12 @@ typedef enum {
SP_STATE_READ_VERFBYTES, /* read verifier data */
SP_STATE_READING_PROGHDR,
SP_STATE_READ_PROGHDR,
+ SP_STATE_READING_PROGHDR_XDATA,
+ SP_STATE_READ_PROGHDR_XDATA, /* It's a bad "name" in the generic
+ RPC state machine, but greatly
+ aids code review (and xdata is
+ the only "consumer" of this state)
+ */
SP_STATE_READING_PROG,
} sp_rpcfrag_vectored_request_state_t;
@@ -165,6 +171,7 @@ typedef struct {
sp_rpcfrag_simple_msg_state_t simple_state;
sp_rpcfrag_state_t state;
} frag;
+ char *proghdr_base_addr;
struct iobuf *iobuf;
size_t iobuf_size;
struct iovec vector[2];