--- libaitrpc/src/srv.c 2011/08/31 17:11:58 1.4.2.4 +++ libaitrpc/src/srv.c 2011/09/01 11:39:27 1.4.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.4.2.4 2011/08/31 17:11:58 misho Exp $ +* $Id: srv.c,v 1.4.2.5 2011/09/01 11:39:27 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -129,12 +129,14 @@ rpc_srv_dispatchCall(void *arg) if ((ret = rpc_srv_execCall(f, rpc, arr)) == -1) ret = -9; else { - io_arrayDestroy(&arr); + if (arr) + io_arrayDestroy(&arr); argc = rpc_srv_getVars(f, &arr); goto makeReply; /* Call finish OK */ } - io_arrayDestroy(&arr); + if (arr) + io_arrayDestroy(&arr); makeReply: /* Made reply */ @@ -152,7 +154,7 @@ makeReply: if (argc && arr) { /* Go Encapsulate variables ... */ if ((i = io_vals2buffer(buf + Limit, s->srv_netbuf - Limit, arr)) == -1) { - rpc_srv_freeVars(f); + rpc_srv_freeVals(f); argc = 0; ret = -7; rpc_SetErr(EMSGSIZE, "Error:: in prepare RPC packet values (-7) ...\n"); @@ -160,7 +162,7 @@ makeReply: } else { Limit += i; - rpc_srv_freeVars(f); + rpc_srv_freeVals(f); } } @@ -410,8 +412,8 @@ rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, u_s pthread_mutex_lock(&srv->srv_mtx); rpc_srv_registerCall(srv, NULL, CALL_BLOBSHUTDOWN, 0); - rpc_srv_registerCall(srv, NULL, CALL_BLOBCLIENTS, 0); - rpc_srv_registerCall(srv, NULL, CALL_BLOBVARS, 0); + rpc_srv_registerCall(srv, NULL, CALL_BLOBCLIENTS, 1); + rpc_srv_registerCall(srv, NULL, CALL_BLOBVARS, 1); rpc_srv_registerCall(srv, NULL, CALL_BLOBSTATE, 1); pthread_mutex_unlock(&srv->srv_mtx); @@ -672,9 +674,9 @@ rpc_srv_initServer(u_int regProgID, u_int regProcID, i pthread_mutex_init(&srv->srv_mtx, NULL); rpc_srv_registerCall(srv, NULL, CALL_SRVSHUTDOWN, 0); - rpc_srv_registerCall(srv, NULL, CALL_SRVCLIENTS, 0); - rpc_srv_registerCall(srv, NULL, CALL_SRVCALLS, 0); - rpc_srv_registerCall(srv, NULL, CALL_SRVSESSIONS, 0); + rpc_srv_registerCall(srv, NULL, CALL_SRVCLIENTS, 1); + rpc_srv_registerCall(srv, NULL, CALL_SRVSESSIONS, 4); + rpc_srv_registerCall(srv, NULL, CALL_SRVCALLS, 1); return srv; }