--- libaitrpc/src/cli.c 2012/05/17 15:14:16 1.9.2.10 +++ libaitrpc/src/cli.c 2012/05/17 15:24:28 1.9.2.12 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.9.2.10 2012/05/17 15:14:16 misho Exp $ +* $Id: cli.c,v 1.9.2.12 2012/05/17 15:24:28 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -102,8 +102,9 @@ rpc_cli_openBLOBClient(rpc_cli_t * __restrict rpccli, close(cli->cli_sock); free(cli); return NULL; - } else + } /*else fcntl(cli->cli_sock, F_SETFL, fcntl(cli->cli_sock, F_GETFL) | O_NONBLOCK); + */ return cli; } @@ -136,7 +137,7 @@ rpc_cli_closeBLOBClient(rpc_cli_t ** __restrict cli) * * @ProgID = ProgramID for RPC session request * @ProcID = ProcessID for RPC session request - * @netBuf = Network buffer length, if =0 == BUFSIZ (also meaning max RPC packet) + * @netBuf = Network buffer length (min:512 bytes), if =0 == BUFSIZ (also meaning max RPC packet) * @csHost = Host name or IP address for bind server * @Port = Port for bind server, if Port == 0 default port is selected * return: NULL == error or !=NULL connection to RPC server established @@ -151,8 +152,10 @@ rpc_cli_openClient(u_int ProgID, u_char ProcID, int ne return NULL; if (!Port) Port = RPC_DEFPORT; - if (!netBuf) + if (netBuf < RPC_MIN_BUFSIZ) netBuf = BUFSIZ; + else + netBuf = io_align(netBuf, 1); /* align netBuf length */ #ifdef HAVE_SRANDOMDEV srandomdev(); @@ -200,8 +203,9 @@ rpc_cli_openClient(u_int ProgID, u_char ProcID, int ne free(cli->cli_parent); free(cli); return NULL; - } else + } /*else fcntl(cli->cli_sock, F_SETFL, fcntl(cli->cli_sock, F_GETFL) | O_NONBLOCK); + */ return cli; }