--- libaitrpc/src/srv.c 2011/07/14 01:52:48 1.2.2.4 +++ libaitrpc/src/srv.c 2011/07/14 02:36:57 1.2.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.2.2.4 2011/07/14 01:52:48 misho Exp $ +* $Id: srv.c,v 1.2.2.5 2011/07/14 02:36:57 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -55,6 +55,7 @@ rpc_srv_dispatchCall(void *arg) rpc_func_t *f = NULL; struct tagRPCCall *rpc; struct tagRPCRet *rrpc; + rpc_sess_t ses = { 0 }; fd_set fds; u_char buf[BUFSIZ], *data; int ret, argc = 0, Limit = 0; @@ -147,6 +148,7 @@ rpc_srv_dispatchCall(void *arg) argc = 0; vals = NULL; + memcpy(&ses, &rpc->call_session, sizeof ses); if (!(f = rpc_srv_getCall(s, rpc->call_tag, rpc->call_hash))) { rpc_SetErr(EINVAL, "Error:: call not found into RPC server ...\n"); ret = -6; @@ -155,13 +157,12 @@ rpc_srv_dispatchCall(void *arg) ret = -9; else argc = rpc_srv_getValsCall(f, &vals); - makeReply: memset(buf, 0, BUFSIZ); rrpc = (struct tagRPCRet*) buf; Limit = sizeof(struct tagRPCRet); - memcpy(&rrpc->ret_session, &rpc->call_session, sizeof rrpc->ret_session); + memcpy(&rrpc->ret_session, &ses, sizeof(rpc_sess_t)); rrpc->ret_tag = rpc->call_tag; rrpc->ret_hash = rpc->call_hash; rrpc->ret_errno = rpc_Errno;