--- libaitio/src/sock.c 2013/11/21 15:13:52 1.4.4.4 +++ libaitio/src/sock.c 2013/11/21 18:26:40 1.4.4.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: sock.c,v 1.4.4.4 2013/11/21 15:13:52 misho Exp $ +* $Id: sock.c,v 1.4.4.5 2013/11/21 18:26:40 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -61,7 +61,8 @@ io_closeClient(sched_task_t *task) shutdown(sock, SHUT_RDWR); close(sock); } - AIT_FREE_VAL(&cli->cli_buf); + AIT_FREE_VAL(&cli->cli_buf[1]); + AIT_FREE_VAL(&cli->cli_buf[0]); e_free(cli); taskExit(task, NULL); @@ -108,7 +109,8 @@ io_acceptClient(sched_task_t *task) cli->cli_fd = c; cli->cli_func = TASK_DATA(task); memcpy(&cli->cli_addr, &sa, sizeof cli->cli_addr); - AIT_SET_BUFSIZ(&cli->cli_buf, 0, AIT_LEN(&s->sock_buf)); + AIT_SET_BUFSIZ(&cli->cli_buf[0], 0, AIT_LEN(&s->sock_buf)); + AIT_SET_BUFSIZ(&cli->cli_buf[1], 0, AIT_LEN(&s->sock_buf)); schedRead(TASK_ROOT(task), cli->cli_func, cli, cli->cli_fd, TASK_ARG(task), 0); ioUpdTimerSocket(cli); @@ -229,7 +231,8 @@ ioCloseSocket(sock_t ** __restrict s) shutdown(cli->cli_fd, SHUT_RDWR); close(cli->cli_fd); } - AIT_FREE_VAL(&cli->cli_buf); + AIT_FREE_VAL(&cli->cli_buf[1]); + AIT_FREE_VAL(&cli->cli_buf[0]); e_free(cli); } pthread_mutex_unlock(&(*s)->sock_mtx);