--- libaitrpc/src/cli.c 2013/11/15 09:18:38 1.19.6.2 +++ libaitrpc/src/cli.c 2013/11/15 09:49:37 1.19.6.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.19.6.2 2013/11/15 09:18:38 misho Exp $ +* $Id: cli.c,v 1.19.6.3 2013/11/15 09:49:37 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -295,8 +295,10 @@ rpc_pkt_Receive(int sock, int type, sockaddr_t * __res if (!pkt) { rpc_SetErr(EINVAL, "Invalid argument(s)!"); return -1; - } else + } else { buf = AIT_GET_BUF(pkt); + rpc = (struct tagRPCCall*) buf; + } /* reply from RPC server */ do { @@ -316,13 +318,12 @@ rpc_pkt_Receive(int sock, int type, sockaddr_t * __res } /* calc estimated length */ - rpc = (struct tagRPCCall*) buf; estlen = ntohl(rpc->call_len); if (estlen > AIT_LEN(pkt)) AIT_RE_BUF(pkt, estlen); buf = AIT_GET_BUF(pkt); - blen = estlen; rpc = (struct tagRPCCall*) buf; + blen = estlen; continue; }