From b894944857a7ce61a3bd31566d6169ed8d19ce8b Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sun, 25 Sep 2011 18:34:14 +0530 Subject: rpc: fix wrong wiping of state machine's state The macro __socket_proto_read() is used to read one sub-header in a fragment after another. It also has to 'get out' of the state machine's switch/case construct in two situations - a) finished reading the full header b) after a partial read, (and return in the same state at next pollin) The 'reset' of the state should happen only after a full read of the header and not if there was a partial read of the header. Change-Id: I3650a83e1fae0f317cfd1b549835c72e39dc5253 --- rpc/rpc-transport/socket/src/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 00adc6def..089afb573 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -82,7 +82,7 @@ priv->incoming.frag.bytes_read += bytes_read; \ \ if ((ret > 0) || (priv->incoming.frag.remaining_size != 0)) { \ - if (priv->incoming.frag.remaining_size != 0) { \ + if (priv->incoming.frag.remaining_size != 0 && ret == 0) { \ __socket_proto_reset_pending (priv); \ } \ \ -- cgit