--- libaitrpc/src/srv.c 2012/11/19 21:35:43 1.12.2.11 +++ libaitrpc/src/srv.c 2013/07/15 14:54:40 1.16.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.12.2.11 2012/11/19 21:35:43 misho Exp $ +* $Id: srv.c,v 1.16.2.3 2013/07/15 14:54:40 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -67,7 +67,7 @@ static sched_task_func_t cbProto[SOCK_RAW + 1][4] = { }; -inline void +void rpc_freeCli(rpc_cli_t * __restrict c) { rpc_srv_t *s = c->cli_parent; @@ -77,32 +77,32 @@ rpc_freeCli(rpc_cli_t * __restrict c) /* free buffer */ AIT_FREE_VAL(&c->cli_buf); - io_arrayDel(s->srv_clients, c->cli_id, 0); + array_Del(s->srv_clients, c->cli_id, 0); if (c) - io_free(c); + e_free(c); } static inline int -_check4freeslot(rpc_srv_t * __restrict srv, io_sockaddr_t * __restrict sa) +_check4freeslot(rpc_srv_t * __restrict srv, sockaddr_t * __restrict sa) { rpc_cli_t *c = NULL; register int i; /* check free slots for connect */ - for (i = 0; i < io_arraySize(srv->srv_clients) && - (c = io_array(srv->srv_clients, i, rpc_cli_t*)); i++) + for (i = 0; i < array_Size(srv->srv_clients) && + (c = array(srv->srv_clients, i, rpc_cli_t*)); i++) /* check for duplicates */ - if (sa && !io_addrcmp(&c->cli_sa, sa, 42)) + if (sa && !e_addrcmp(&c->cli_sa, sa, 42)) break; - if (i >= io_arraySize(srv->srv_clients)) + if (i >= array_Size(srv->srv_clients)) return -1; /* no more free slots! */ return i; } static rpc_cli_t * -_allocClient(rpc_srv_t * __restrict srv, io_sockaddr_t * __restrict sa) +_allocClient(rpc_srv_t * __restrict srv, sockaddr_t * __restrict sa) { rpc_cli_t *c = NULL; int n; @@ -111,23 +111,23 @@ _allocClient(rpc_srv_t * __restrict srv, io_sockaddr_t if (n == -1) return NULL; else - c = io_array(srv->srv_clients, n, rpc_cli_t*); + c = array(srv->srv_clients, n, rpc_cli_t*); if (!c) { - c = io_malloc(sizeof(rpc_cli_t)); + c = e_malloc(sizeof(rpc_cli_t)); if (!c) { LOGERR; srv->srv_kill = 1; return NULL; } else { memset(c, 0, sizeof(rpc_cli_t)); - io_arraySet(srv->srv_clients, n, c); + array_Set(srv->srv_clients, n, c); c->cli_id = n; c->cli_parent = srv; } /* alloc empty buffer */ - AIT_SET_BUF2(&c->cli_buf, 0, srv->srv_netbuf); + AIT_SET_BUFSIZ(&c->cli_buf, 0, srv->srv_netbuf); } return c; @@ -176,11 +176,11 @@ txPacket(sched_task_t *task) rpc->call_rep.ret = RPC_ERROR(-1); rpc->call_rep.eno = RPC_ERROR(rpc_Errno); } else { - rpc->call_argc = htons(io_arraySize(RPC_RETVARS(c))); + rpc->call_argc = htons(array_Size(RPC_RETVARS(c))); /* Go Encapsulate variables */ - ret = io_vars2buffer(buf + wlen, sizeof buf - wlen, RPC_RETVARS(c)); + ret = ait_vars2buffer(buf + wlen, sizeof buf - wlen, RPC_RETVARS(c)); /* Free return values */ - io_freeVars(&c->cli_vars); + ait_freeVars(&c->cli_vars); if (ret == -1) { rpc_SetErr(EBADRPC, "Prepare RPC packet failed"); rpc->call_argc ^= rpc->call_argc; @@ -193,9 +193,11 @@ txPacket(sched_task_t *task) rpc->call_len = htons(wlen); +#if 0 /* calculate CRC */ rpc->call_crc ^= rpc->call_crc; rpc->call_crc = htons(crcFletcher16((u_short*) buf, wlen / 2)); +#endif /* send reply */ ret = send(TASK_FD(task), buf, wlen, MSG_NOSIGNAL); @@ -221,11 +223,11 @@ execCall(sched_task_t *task) /* Go decapsulate variables ... */ if (argc) { - arr = io_buffer2vars(buf + sizeof(struct tagRPCCall), + arr = ait_buffer2vars(buf + sizeof(struct tagRPCCall), AIT_LEN(&c->cli_buf) - TASK_VAL(task) - sizeof(struct tagRPCCall), argc, 42); if (!arr) { - rpc_SetErr(ERPCMISMATCH, "#%d - %s", io_GetErrno(), io_GetError()); + rpc_SetErr(ERPCMISMATCH, "#%d - %s", elwix_GetErrno(), elwix_GetError()); rpc->call_argc ^= rpc->call_argc; rpc->call_rep.ret = RPC_ERROR(-1); rpc->call_rep.eno = RPC_ERROR(rpc_Errno); @@ -250,16 +252,16 @@ execCall(sched_task_t *task) rpc->call_rep.eno ^= rpc->call_rep.eno; if (argc) { /* without reply */ - io_freeVars(&c->cli_vars); + ait_freeVars(&c->cli_vars); rpc->call_argc ^= rpc->call_argc; } else { /* reply */ - rpc->call_argc = htons(io_arraySize(RPC_RETVARS(c))); + rpc->call_argc = htons(array_Size(RPC_RETVARS(c))); } } } - io_arrayDestroy(&arr); + array_Destroy(&arr); return NULL; } @@ -269,7 +271,10 @@ rxPacket(sched_task_t *task) rpc_cli_t *c = TASK_ARG(task); rpc_srv_t *s = c->cli_parent; int len, rlen, noreply; - u_short crc, off = TASK_DATLEN(task); + u_short off = TASK_DATLEN(task); +#if 0 + u_short crc; +#endif u_char *buf = AIT_GET_BUF(&c->cli_buf); struct tagRPCCall *rpc; @@ -308,6 +313,7 @@ rxPacket(sched_task_t *task) break; } +#if 0 /* check integrity of packet */ crc = ntohs(rpc->call_crc); rpc->call_crc ^= rpc->call_crc; @@ -318,6 +324,7 @@ rxPacket(sched_task_t *task) /* try next packet remaining into buffer */ continue; } +#endif noreply = RPC_CHK_NOREPLY(rpc); @@ -350,7 +357,7 @@ acceptClients(sched_task_t *task) { rpc_srv_t *srv = TASK_ARG(task); rpc_cli_t *c = NULL; - socklen_t salen = sizeof(io_sockaddr_t); + socklen_t salen = sizeof(sockaddr_t); c = _allocClient(srv, NULL); if (!c) @@ -361,7 +368,7 @@ acceptClients(sched_task_t *task) if (c->cli_sock == -1) { LOGERR; AIT_FREE_VAL(&c->cli_buf); - io_arrayDel(srv->srv_clients, c->cli_id, 42); + array_Del(srv->srv_clients, c->cli_id, 42); goto end; } else fcntl(c->cli_sock, F_SETFL, fcntl(c->cli_sock, F_GETFL) | O_NONBLOCK); @@ -400,11 +407,11 @@ txUDPPacket(sched_task_t *task) rpc->call_rep.ret = RPC_ERROR(-1); rpc->call_rep.eno = RPC_ERROR(rpc_Errno); } else { - rpc->call_argc = htons(io_arraySize(RPC_RETVARS(c))); + rpc->call_argc = htons(array_Size(RPC_RETVARS(c))); /* Go Encapsulate variables */ - ret = io_vars2buffer(buf + wlen, sizeof buf - wlen, RPC_RETVARS(c)); + ret = ait_vars2buffer(buf + wlen, sizeof buf - wlen, RPC_RETVARS(c)); /* Free return values */ - io_freeVars(&c->cli_vars); + ait_freeVars(&c->cli_vars); if (ret == -1) { rpc_SetErr(EBADRPC, "Prepare RPC packet failed"); rpc->call_argc ^= rpc->call_argc; @@ -438,15 +445,16 @@ rxUDPPacket(sched_task_t *task) { rpc_srv_t *srv = TASK_ARG(task); rpc_cli_t *c = NULL; - socklen_t salen = sizeof(io_sockaddr_t); int len, rlen, noreply; u_short crc, off = 0; u_char buf[USHRT_MAX + 1]; struct tagRPCCall *rpc = (struct tagRPCCall*) buf; - io_sockaddr_t sa; + sockaddr_t sa; + socklen_t salen; struct timespec ts = { DEF_RPC_TIMEOUT, 0 }; /* receive connect packet */ + salen = sa.ss.ss_len = sizeof(sockaddr_t); rlen = recvfrom(TASK_FD(task), buf, sizeof buf, 0, &sa.sa, &salen); if (rlen < 1) goto end; @@ -521,7 +529,7 @@ end: /* ------------------------------------------------------ */ -inline void +void rpc_freeBLOBCli(rpc_cli_t * __restrict c) { rpc_srv_t *s = c->cli_parent; @@ -531,9 +539,9 @@ rpc_freeBLOBCli(rpc_cli_t * __restrict c) /* free buffer */ AIT_FREE_VAL(&c->cli_buf); - io_arrayDel(s->srv_blob.clients, c->cli_id, 0); + array_Del(s->srv_blob.clients, c->cli_id, 0); if (c) - io_free(c); + e_free(c); } @@ -555,13 +563,8 @@ txBLOB(sched_task_t *task) { rpc_cli_t *c = TASK_ARG(task); u_char *buf = AIT_GET_BUF(&c->cli_buf); - struct tagBLOBHdr *blob = (struct tagBLOBHdr *) buf; int wlen = sizeof(struct tagBLOBHdr); - /* calculate CRC */ - blob->hdr_crc ^= blob->hdr_crc; - blob->hdr_crc = htons(crcFletcher16((u_short*) buf, wlen / 2)); - /* send reply */ wlen = send(TASK_FD(task), buf, wlen, MSG_NOSIGNAL); if (wlen == -1 || wlen != sizeof(struct tagBLOBHdr)) { @@ -580,7 +583,6 @@ rxBLOB(sched_task_t *task) rpc_blob_t *b; struct tagBLOBHdr blob; int rlen; - u_short crc; memset(&blob, 0, sizeof blob); rlen = recv(TASK_FD(task), &blob, sizeof blob, 0); @@ -598,18 +600,8 @@ rxBLOB(sched_task_t *task) return NULL; } - /* check integrity of packet */ - crc = ntohs(blob.hdr_crc); - blob.hdr_crc ^= blob.hdr_crc; - if (crc != crcFletcher16((u_short*) &blob, rlen / 2)) { - rpc_SetErr(ERPCMISMATCH, "Bad CRC BLOB packet"); - - schedReadSelf(task); - return NULL; - } - /* check RPC packet session info */ - if ((crc = rpc_chkPktSession(&blob.hdr_session, &s->srv_session))) { + if (rpc_chkPktSession(&blob.hdr_session, &s->srv_session)) { rpc_SetErr(ERPCMISMATCH, "Get invalid RPC session"); blob.hdr_cmd = error; goto end; @@ -636,7 +628,8 @@ rxBLOB(sched_task_t *task) } break; case set: - if ((b = rpc_srv_registerBLOB(s, ntohl(blob.hdr_len)))) { + if ((b = rpc_srv_registerBLOB(s, ntohl(blob.hdr_len), + ntohl(blob.hdr_ret), task))) { /* set new BLOB variable for reply :) */ blob.hdr_var = htonl(b->blob_var); @@ -653,6 +646,9 @@ rxBLOB(sched_task_t *task) blob.hdr_cmd = error; blob.hdr_ret = RPC_ERROR(-1); } + + schedCancelby(TASK_ROOT(task), taskTIMER, CRITERIA_DATA, + (void*) (intptr_t) ntohl(blob.hdr_var), NULL); break; default: rpc_SetErr(EPROCUNAVAIL, "Unsupported BLOB command %d", blob.hdr_cmd); @@ -673,37 +669,37 @@ acceptBLOBClients(sched_task_t *task) rpc_srv_t *srv = TASK_ARG(task); rpc_cli_t *c = NULL; register int i; - socklen_t salen = sizeof(io_sockaddr_t); + socklen_t salen = sizeof(sockaddr_t); #ifdef TCP_NOPUSH int n = 1; #endif /* check free slots for connect */ - for (i = 0; i < io_arraySize(srv->srv_blob.clients) && - (c = io_array(srv->srv_blob.clients, i, rpc_cli_t*)); i++); + for (i = 0; i < array_Size(srv->srv_blob.clients) && + (c = array(srv->srv_blob.clients, i, rpc_cli_t*)); i++); if (c) /* no more free slots! */ goto end; - c = io_malloc(sizeof(rpc_cli_t)); + c = e_malloc(sizeof(rpc_cli_t)); if (!c) { LOGERR; srv->srv_kill = srv->srv_blob.kill = 1; return NULL; } else { memset(c, 0, sizeof(rpc_cli_t)); - io_arraySet(srv->srv_blob.clients, i, c); + array_Set(srv->srv_blob.clients, i, c); c->cli_id = i; c->cli_parent = srv; } /* alloc empty buffer */ - AIT_SET_BUF2(&c->cli_buf, 0, srv->srv_netbuf); + AIT_SET_BUFSIZ(&c->cli_buf, 0, srv->srv_netbuf); /* accept client */ c->cli_sock = accept(TASK_FD(task), &c->cli_sa.sa, &salen); if (c->cli_sock == -1) { LOGERR; AIT_FREE_VAL(&c->cli_buf); - io_arrayDel(srv->srv_blob.clients, i, 42); + array_Del(srv->srv_blob.clients, i, 42); goto end; } else { #ifdef TCP_NOPUSH @@ -750,7 +746,7 @@ rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, u_s srv->srv_blob.server.cli_parent = srv; - memcpy(&srv->srv_blob.server.cli_sa, &srv->srv_server.cli_sa, sizeof(io_sockaddr_t)); + memcpy(&srv->srv_blob.server.cli_sa, &srv->srv_server.cli_sa, sizeof(sockaddr_t)); switch (srv->srv_blob.server.cli_sa.sa.sa_family) { case AF_INET: srv->srv_blob.server.cli_sa.sin.sin_port = @@ -807,9 +803,9 @@ rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, u_s /* allocate pool for concurent blob clients */ - srv->srv_blob.clients = io_arrayInit(io_arraySize(srv->srv_clients)); + srv->srv_blob.clients = array_Init(array_Size(srv->srv_clients)); if (!srv->srv_blob.clients) { - rpc_SetErr(io_GetErrno(), "%s", io_GetError()); + rpc_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); close(srv->srv_blob.server.cli_sock); AIT_FREE_VAL(&srv->srv_blob.dir); return -1; @@ -819,7 +815,7 @@ rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, u_s srv->srv_blob.root = schedBegin(); if (!srv->srv_blob.root) { rpc_SetErr(sched_GetErrno(), "%s", sched_GetError()); - io_arrayDestroy(&srv->srv_blob.clients); + array_Destroy(&srv->srv_blob.clients); close(srv->srv_blob.server.cli_sock); AIT_FREE_VAL(&srv->srv_blob.dir); return -1; @@ -834,7 +830,7 @@ rpc_srv_initBLOBServer(rpc_srv_t * __restrict srv, u_s * @srv = RPC Server instance * return: none */ -inline void +void rpc_srv_endBLOBServer(rpc_srv_t * __restrict srv) { if (!srv) @@ -862,7 +858,7 @@ rpc_srv_loopBLOBServer(rpc_srv_t * __restrict srv) return -1; } - if (listen(srv->srv_blob.server.cli_sock, io_arraySize(srv->srv_blob.clients)) == -1) { + if (listen(srv->srv_blob.server.cli_sock, array_Size(srv->srv_blob.clients)) == -1) { LOGERR; return -1; } @@ -878,8 +874,8 @@ rpc_srv_loopBLOBServer(rpc_srv_t * __restrict srv) schedRun(srv->srv_blob.root, &srv->srv_blob.kill); /* close all clients connections & server socket */ - for (i = 0; i < io_arraySize(srv->srv_blob.clients); i++) { - c = io_array(srv->srv_blob.clients, i, rpc_cli_t*); + for (i = 0; i < array_Size(srv->srv_blob.clients); i++) { + c = array(srv->srv_blob.clients, i, rpc_cli_t*); if (c) { shutdown(c->cli_sock, SHUT_RDWR); close(c->cli_sock); @@ -887,9 +883,9 @@ rpc_srv_loopBLOBServer(rpc_srv_t * __restrict srv) schedCancelby(srv->srv_blob.root, taskMAX, CRITERIA_ARG, c, NULL); AIT_FREE_VAL(&c->cli_buf); } - io_arrayDel(srv->srv_blob.clients, i, 42); + array_Del(srv->srv_blob.clients, i, 42); } - io_arrayDestroy(&srv->srv_blob.clients); + array_Destroy(&srv->srv_blob.clients); close(srv->srv_blob.server.cli_sock); @@ -898,7 +894,7 @@ rpc_srv_loopBLOBServer(rpc_srv_t * __restrict srv) TAILQ_REMOVE(&srv->srv_blob.blobs, b, blob_node); rpc_srv_blobFree(srv, b); - io_free(b); + e_free(b); } schedEnd(&srv->srv_blob.root); @@ -910,8 +906,7 @@ rpc_srv_loopBLOBServer(rpc_srv_t * __restrict srv) /* * rpc_srv_initServer() - Init & create RPC Server * - * @regProgID = ProgramID for authentication & recognition - * @regProcID = ProcessID for authentication & recognition + * @InstID = Instance for authentication & recognition * @concurentClients = Concurent clients at same time to this server * @netBuf = Network buffer length (min:512 bytes), if =0 == BUFSIZ (also meaning max RPC packet) * @csHost = Host name or address for bind server, if NULL any address @@ -920,18 +915,18 @@ rpc_srv_loopBLOBServer(rpc_srv_t * __restrict srv) * return: NULL == error or !=NULL bind and created RPC server instance */ rpc_srv_t * -rpc_srv_initServer(u_int regProgID, u_char regProcID, int concurentClients, - int netBuf, const char *csHost, u_short Port, int proto) +rpc_srv_initServer(u_char InstID, int concurentClients, int netBuf, + const char *csHost, u_short Port, int proto) { int n = 1; rpc_srv_t *srv = NULL; - io_sockaddr_t sa = IO_SOCKADDR_INIT; + sockaddr_t sa = E_SOCKADDR_INIT; - if (!concurentClients || !regProgID || (proto < 0 || proto > SOCK_DGRAM)) { + if (!concurentClients || (proto < 0 || proto > SOCK_DGRAM)) { rpc_SetErr(EINVAL, "Invalid parameters can`t init RPC server"); return NULL; } - if (!io_gethostbyname(csHost, Port, &sa)) + if (!e_gethostbyname(csHost, Port, &sa)) return NULL; if (!Port) Port = RPC_DEFPORT; @@ -940,7 +935,7 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, if (netBuf < RPC_MIN_BUFSIZ) netBuf = BUFSIZ; else - netBuf = io_align(netBuf, 2); /* align netBuf length */ + netBuf = E_ALIGN(netBuf, 2); /* align netBuf length */ #ifdef HAVE_SRANDOMDEV srandomdev(); @@ -950,7 +945,7 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, srandom((time(&tim) ^ getpid())); #endif - srv = io_malloc(sizeof(rpc_srv_t)); + srv = e_malloc(sizeof(rpc_srv_t)); if (!srv) { LOGERR; return NULL; @@ -960,8 +955,7 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, srv->srv_proto = proto; srv->srv_netbuf = netBuf; srv->srv_session.sess_version = RPC_VERSION; - srv->srv_session.sess_program = regProgID; - srv->srv_session.sess_process = regProcID; + srv->srv_session.sess_instance = InstID; srv->srv_server.cli_parent = srv; memcpy(&srv->srv_server.cli_sa, &sa, sizeof srv->srv_server.cli_sa); @@ -976,17 +970,17 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, if (!srv->srv_root) { rpc_SetErr(sched_GetErrno(), "%s", sched_GetError()); pthread_mutex_destroy(&srv->srv_funcs.mtx); - io_free(srv); + e_free(srv); return NULL; } /* init pool for clients */ - srv->srv_clients = io_arrayInit(concurentClients); + srv->srv_clients = array_Init(concurentClients); if (!srv->srv_clients) { - rpc_SetErr(io_GetErrno(), "%s", io_GetError()); + rpc_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); schedEnd(&srv->srv_root); pthread_mutex_destroy(&srv->srv_funcs.mtx); - io_free(srv); + e_free(srv); return NULL; } @@ -994,10 +988,10 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, srv->srv_server.cli_sock = socket(srv->srv_server.cli_sa.sa.sa_family, srv->srv_proto, 0); if (srv->srv_server.cli_sock == -1) { LOGERR; - io_arrayDestroy(&srv->srv_clients); + array_Destroy(&srv->srv_clients); schedEnd(&srv->srv_root); pthread_mutex_destroy(&srv->srv_funcs.mtx); - io_free(srv); + e_free(srv); return NULL; } if (setsockopt(srv->srv_server.cli_sock, SOL_SOCKET, SO_REUSEADDR, &n, sizeof n) == -1) { @@ -1026,10 +1020,10 @@ rpc_srv_initServer(u_int regProgID, u_char regProcID, return srv; err: /* error condition */ close(srv->srv_server.cli_sock); - io_arrayDestroy(&srv->srv_clients); + array_Destroy(&srv->srv_clients); schedEnd(&srv->srv_root); pthread_mutex_destroy(&srv->srv_funcs.mtx); - io_free(srv); + e_free(srv); return NULL; } @@ -1039,7 +1033,7 @@ err: /* error condition */ * @psrv = RPC Server instance * return: none */ -inline void +void rpc_srv_endServer(rpc_srv_t ** __restrict psrv) { if (!psrv || !*psrv) @@ -1053,7 +1047,7 @@ rpc_srv_endServer(rpc_srv_t ** __restrict psrv) sleep(RPC_SCHED_POLLING); pthread_mutex_destroy(&(*psrv)->srv_funcs.mtx); - io_free(*psrv); + e_free(*psrv); *psrv = NULL; } @@ -1077,8 +1071,7 @@ rpc_srv_loopServer(rpc_srv_t * __restrict srv) } if (srv->srv_proto == SOCK_STREAM) - if (listen(srv->srv_server.cli_sock, - io_arraySize(srv->srv_clients)) == -1) { + if (listen(srv->srv_server.cli_sock, array_Size(srv->srv_clients)) == -1) { LOGERR; return -1; } @@ -1094,19 +1087,19 @@ rpc_srv_loopServer(rpc_srv_t * __restrict srv) schedRun(srv->srv_root, &srv->srv_kill); /* close all clients connections & server socket */ - for (i = 0; i < io_arraySize(srv->srv_clients); i++) { - c = io_array(srv->srv_clients, i, rpc_cli_t*); + for (i = 0; i < array_Size(srv->srv_clients); i++) { + c = array(srv->srv_clients, i, rpc_cli_t*); if (c) { shutdown(c->cli_sock, SHUT_RDWR); close(c->cli_sock); schedCancelby(srv->srv_root, taskMAX, CRITERIA_ARG, c, NULL); - io_freeVars(&RPC_RETVARS(c)); + ait_freeVars(&RPC_RETVARS(c)); AIT_FREE_VAL(&c->cli_buf); } - io_arrayDel(srv->srv_clients, i, 42); + array_Del(srv->srv_clients, i, 42); } - io_arrayDestroy(&srv->srv_clients); + array_Destroy(&srv->srv_clients); close(srv->srv_server.cli_sock); @@ -1116,7 +1109,7 @@ rpc_srv_loopServer(rpc_srv_t * __restrict srv) SLIST_REMOVE_HEAD(&srv->srv_funcs, func_next); AIT_FREE_VAL(&f->func_name); - io_free(f); + e_free(f); } srv->srv_funcs.avlh_root = NULL; RPC_FUNCS_UNLOCK(&srv->srv_funcs);