--- libaitrpc/src/srv.c 2024/02/26 18:25:32 1.30.2.10 +++ libaitrpc/src/srv.c 2024/03/20 16:53:08 1.30.2.11 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.30.2.10 2024/02/26 18:25:32 misho Exp $ +* $Id: srv.c,v 1.30.2.11 2024/03/20 16:53:08 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -147,6 +147,11 @@ _allocClient(rpc_srv_t * __restrict srv, sockaddr_t * /* alloc empty buffer */ AIT_SET_BUFSIZ(&c->cli_buf, 0, srv->srv_netbuf); + if (!AIT_GET_BUF(&c->cli_buf)) { + array_Del(srv->srv_clients, n, 0); + e_free(c); + c = NULL; + } } return c; @@ -308,7 +313,7 @@ rxPacket(sched_task_t *task) { rpc_cli_t *c = TASK_ARG(task); rpc_srv_t *s = c->cli_parent; - int len, noreply = 0, rlen = AIT_LEN(&c->cli_buf); + int len, noreply = 0, rlen; #if 0 u_short crc; #endif @@ -998,7 +1003,7 @@ rxEXTPacket(sched_task_t *task) { rpc_srv_t *srv = TASK_ARG(task); rpc_cli_t *c = NULL; - int len, noreply = 0, rlen = AIT_LEN(&c->cli_buf); + int len, noreply = 0, rlen; struct tagRPCCall *rpc; struct timespec ts = { DEF_RPC_TIMEOUT, 0 }; sockaddr_t sa;