--- libaitrpc/src/cli.c 2016/08/08 13:21:13 1.27 +++ libaitrpc/src/cli.c 2020/06/25 19:11:00 1.28 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.27 2016/08/08 13:21:13 misho Exp $ +* $Id: cli.c,v 1.28 2020/06/25 19:11:00 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 - 2016 +Copyright 2004 - 2019 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -405,7 +405,7 @@ rpc_pkt_Receive(int sock, int type, sockaddr_t * __res if (seq != ntohl(rpc->call_seq)) continue; } - } while (ret < 1); + } while (ret < 0); return ret; } @@ -605,14 +605,16 @@ rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short if ((wlen = rpc_pkt_Receive(cli->cli_sock, cli->cli_id, &cli->cli_sa, &cli->cli_buf, seq)) == -1) return -1; - if (!wlen) /* closed rpc connection */ - return 1; + if (!wlen) { /* closed rpc connection */ + rpc_SetErr(ECONNRESET, "Closed connection"); + return -1; + } if ((wlen = rpc_pkt_Replay(&cli->cli_buf, cli->cli_parent, tag, out_vars, type)) == -1) return -1; - return 0; + return wlen; } /*