--- libaitrpc/src/srv.c 2012/03/15 01:22:55 1.6.2.10 +++ libaitrpc/src/srv.c 2012/03/15 01:32:21 1.6.2.11 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.6.2.10 2012/03/15 01:22:55 misho Exp $ +* $Id: srv.c,v 1.6.2.11 2012/03/15 01:32:21 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -60,7 +60,7 @@ txPacket(sched_task_t *task) int ret, wlen = sizeof(struct tagRPCCall); array_t *arr = NULL; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (rpc->call_argc) { f = rpc_srv_getCall(s, ntohs(rpc->call_tag), ntohl(rpc->call_hash)); @@ -95,7 +95,7 @@ txPacket(sched_task_t *task) rpc_SetErr(EPROCUNAVAIL, "RPC reply, should be send %d bytes, " "really sended %d bytes", wlen, ret); else - LOGGER("Sended %d bytes", ret); + ioDEBUG(RPC_DEBUG_LEVEL, "Sended %d bytes", ret); return NULL; } @@ -111,7 +111,7 @@ execCall(sched_task_t *task) struct tagRPCCall *rpc = (struct tagRPCCall*) buf; int argc = ntohs(rpc->call_argc); - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); /* Go decapsulate variables ... */ if (!(rpc->call_req.flags & RPC_NOREPLY) && argc) { @@ -132,8 +132,8 @@ execCall(sched_task_t *task) rpc->call_rep.ret = RPC_ERROR(-1); rpc->call_rep.eno = RPC_ERROR(rpc_Errno); } else { - LOGGER("RPC function %s from module %s", AIT_GET_STR(&f->func_name), - AIT_GET_LIKE(&f->func_file, char*)); + ioDEBUG(RPC_DEBUG_LEVEL, "RPC function %s from module %s", + AIT_GET_STR(&f->func_name), AIT_GET_LIKE(&f->func_file, char*)); rpc->call_rep.ret = RPC_ERROR(rpc_srv_execCall(f, rpc, arr)); if (rpc->call_rep.ret == htonl(-1)) { @@ -161,7 +161,7 @@ rxPacket(sched_task_t *task) struct tagRPCCall *rpc; struct timespec ts; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); memset(buf, 0, TASK_DATLEN(task)); rlen = recv(TASK_FD(task), buf, TASK_DATLEN(task), 0); @@ -173,7 +173,7 @@ rxPacket(sched_task_t *task) s->srv_kill = s->srv_blob.state = kill; return NULL; } else - LOGGER("Readed %d bytes", rlen); + ioDEBUG(RPC_DEBUG_LEVEL, "Readed %d bytes", rlen); if (rlen < sizeof(struct tagRPCCall)) { rpc_SetErr(ERPCMISMATCH, "Too short RPC packet"); @@ -233,7 +233,7 @@ rpc_srv_dispatchCall(void *arg) sched_root_task_t *root; struct timespec ts = { DEF_RPC_TIMEOUT, 0 }; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!arg) { rpc_SetErr(EINVAL, "Invalid parameter can`t procced RPC client"); @@ -278,7 +278,7 @@ txBLOB(sched_task_t *task) struct tagBLOBHdr *blob = (struct tagBLOBHdr *) buf; int wlen = sizeof(struct tagBLOBHdr); - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); /* calculate CRC */ blob->hdr_crc ^= blob->hdr_crc; @@ -292,7 +292,7 @@ txBLOB(sched_task_t *task) rpc_SetErr(EPROCUNAVAIL, "RPC reply, should be send %d bytes, " "really sended %d bytes", sizeof(struct tagBLOBHdr), wlen); else - LOGGER("Sended %d bytes", wlen); + ioDEBUG(RPC_DEBUG_LEVEL, "Sended %d bytes", wlen); return NULL; } @@ -309,7 +309,7 @@ rxBLOB(sched_task_t *task) u_short crc; struct timespec ts; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); /* check for disable service at this moment? */ if (s->srv_blob.state == disable) { @@ -332,7 +332,7 @@ rxBLOB(sched_task_t *task) s->srv_blob.state = kill; return NULL; } else - LOGGER("Readed %d bytes", rlen); + ioDEBUG(RPC_DEBUG_LEVEL, "Readed %d bytes", rlen); if (rlen < sizeof(struct tagBLOBHdr)) { rpc_SetErr(ERPCMISMATCH, "Too short BLOB packet"); @@ -425,7 +425,7 @@ rpc_srv_dispatchVars(void *arg) u_char *buf; struct timespec ts = { DEF_RPC_TIMEOUT, 0 }; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!arg) { rpc_SetErr(EINVAL, "Invalid parameter can`t procced BLOB"); @@ -478,7 +478,7 @@ rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, u_s int n = 1; io_sockaddr_t sa; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!srv) { rpc_SetErr(EINVAL, "Invalid parameters can`t init BLOB server"); @@ -584,7 +584,7 @@ rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv) register int i; rpc_blob_t *f; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!srv) { rpc_SetErr(EINVAL, "Can`t destroy server because parameter is null!"); @@ -640,7 +640,7 @@ rpc_srv_loopBLOB(rpc_srv_t * __restrict srv) struct timeval tv = { DEF_RPC_TIMEOUT, 0 }; pthread_attr_t attr; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!srv || srv->srv_blob.state == kill) { rpc_SetErr(EINVAL, "Invalid parameter can`t start BLOB server"); @@ -724,7 +724,7 @@ rpc_srv_initServer(u_int regProgID, u_int regProcID, i struct hostent *host = NULL; io_sockaddr_t sa; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!concurentClients || !regProgID || (family != AF_INET && family != AF_INET6 && family != AF_LOCAL)) { @@ -854,7 +854,7 @@ rpc_srv_endServer(rpc_srv_t ** __restrict psrv) register int i; rpc_func_t *f; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!psrv || !*psrv) { rpc_SetErr(EINVAL, "Error:: Can`t destroy server because parameter is null!\n"); @@ -912,7 +912,7 @@ rpc_srv_loopServer(rpc_srv_t * __restrict srv) struct timeval tv = { DEF_RPC_TIMEOUT, 0 }; pthread_attr_t attr; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!srv) { rpc_SetErr(EINVAL, "Error:: Invalid parameter can`t start RPC server ...\n"); @@ -993,7 +993,7 @@ rpc_srv_execCall(rpc_func_t * __restrict call, struct rpc_callback_t func; int ret; - FTRACE(); + ioTRACE(RPC_TRACE_LEVEL); if (!call || !rpc || !call->func_parent) { rpc_SetErr(EINVAL, "Invalid parameter can`t exec function");