--- libaitrpc/src/srv.c 2011/09/07 09:10:55 1.5.2.2 +++ libaitrpc/src/srv.c 2011/09/07 09:22:15 1.5.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.5.2.2 2011/09/07 09:10:55 misho Exp $ +* $Id: srv.c,v 1.5.2.3 2011/09/07 09:22:15 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -60,6 +60,8 @@ rpc_srv_dispatchCall(void *arg) u_char *buf; int ret, argc = 0, Limit = 0; register int i; + uint16_t tag = 0; + uint32_t hash = 0; if (!arg) { rpc_SetErr(EINVAL, "Error:: Invalid parameter can`t procced RPC client ...\n"); @@ -110,6 +112,9 @@ rpc_srv_dispatchCall(void *arg) } else Limit = sizeof(struct tagRPCCall); + tag = rpc->call_tag; + hash = rpc->call_hash; + /* RPC is OK! Go decapsulate variables ... */ if (ntohs(rpc->call_argc)) { arr = io_buffer2vals(buf + Limit, s->srv_netbuf - Limit, @@ -124,7 +129,7 @@ rpc_srv_dispatchCall(void *arg) /* execute call */ argc = 0; memcpy(&ses, &rpc->call_session, sizeof ses); - if (!(f = rpc_srv_getCall(s, ntohs(rpc->call_tag), ntohl(rpc->call_hash)))) { + if (!(f = rpc_srv_getCall(s, ntohs(tag), ntohl(hash)))) { rpc_SetErr(EPROGUNAVAIL, "Error:: call not found into RPC server ...\n"); ret = -6; } else @@ -147,8 +152,8 @@ makeReply: Limit = sizeof(struct tagRPCRet); memcpy(&rrpc->ret_session, &ses, sizeof(rpc_sess_t)); - rrpc->ret_tag = rpc->call_tag; - rrpc->ret_hash = rpc->call_hash; + rrpc->ret_tag = tag; + rrpc->ret_hash = hash; rrpc->ret_errno = htonl(rpc_Errno); rrpc->ret_retcode = htonl(ret); rrpc->ret_argc = htons(argc);