--- libaitrpc/src/srv.c 2013/08/21 13:02:33 1.17.4.7 +++ libaitrpc/src/srv.c 2013/08/21 15:28:16 1.17.4.8 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.17.4.7 2013/08/21 13:02:33 misho Exp $ +* $Id: srv.c,v 1.17.4.8 2013/08/21 15:28:16 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -67,9 +67,15 @@ static sched_task_func_t cbProto[SOCK_RAW + 1][4] = { }; -static inline u_char * -getBuffer(rpc_cli_t * __restrict c) +ait_val_t * +rpc_getBufVar(rpc_cli_t * __restrict c) { + return array(c->cli_buf, RPC_ISNEXTBUF(c), ait_val_t*); +} + +u_char * +rpc_getBuffer(rpc_cli_t * __restrict c) +{ u_char *b = NULL; assert(c); @@ -83,8 +89,8 @@ getBuffer(rpc_cli_t * __restrict c) return b; } -static inline struct tagRPCCall * -getHeader(rpc_cli_t * __restrict c) +struct tagRPCCall * +rpc_getHeader(rpc_cli_t * __restrict c) { assert(c); @@ -255,8 +261,8 @@ execCall(sched_task_t *task) rpc_srv_t *s = c->cli_parent; rpc_func_t *f = NULL; array_t *arr = NULL; - u_char *buf = getBuffer(c); - struct tagRPCCall *rpc = getHeader(c); + u_char *buf = rpc_getBuffer(c); + struct tagRPCCall *rpc = rpc_getHeader(c); int argc = ntohs(rpc->call_argc); /* Go decapsulate variables ... */ @@ -530,9 +536,9 @@ rxUDPPacket(sched_task_t *task) RPC_SET_NEXTBUF(c); } - rpc = getHeader(c); + rpc = rpc_getHeader(c); memcpy(rpc, &rpcbuf, sizeof(struct tagRPCCall)); - memcpy(getBuffer(c), buf, len); + memcpy(rpc_getBuffer(c), buf, len); c->cli_sock = TASK_FD(task); memcpy(&c->cli_sa, sa, sizeof c->cli_sa);