--- libaitrpc/src/cli.c 2011/08/31 17:11:58 1.4.2.4 +++ libaitrpc/src/cli.c 2011/09/01 14:55:42 1.4.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.4.2.4 2011/08/31 17:11:58 misho Exp $ +* $Id: cli.c,v 1.4.2.5 2011/09/01 14:55:42 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -349,7 +349,7 @@ rpc_cli_execCall(rpc_cli_t *cli, const char *csModule, /* marshaling variables */ ret = io_vals2buffer(buf + Limit, cli->cli_netbuf - Limit, in_vars); if (ret == -1) { - rpc_SetErr(EMSGSIZE, "Error:: in prepare RPC packet values (-7) ...\n"); + rpc_SetErr(EBADRPC, "Error:: in prepare RPC packet values (-7) ...\n"); free(buf); return -7; } else @@ -362,7 +362,7 @@ rpc_cli_execCall(rpc_cli_t *cli, const char *csModule, return -1; } if (ret != Limit) { - rpc_SetErr(ECANCELED, "Error:: in send RPC request, should be send %d bytes, really is %d\n", + rpc_SetErr(EPROCUNAVAIL, "Error:: in send RPC request, should be send %d bytes, really is %d\n", Limit, ret); free(buf); return -9; @@ -391,21 +391,21 @@ rpc_cli_execCall(rpc_cli_t *cli, const char *csModule, return 0; } if (ret < sizeof(struct tagRPCRet)) { - rpc_SetErr(EMSGSIZE, "Error:: too short RPC packet ...\n"); + rpc_SetErr(ERPCMISMATCH, "Error:: too short RPC packet ...\n"); free(buf); return -4; } else rrpc = (struct tagRPCRet*) buf; /* check RPC packet session info */ if (memcmp(&rrpc->ret_session, cli->cli_parent, sizeof rrpc->ret_session)) { - rpc_SetErr(EINVAL, "Error:: get invalid RPC session ...\n"); + rpc_SetErr(ERPCMISMATCH, "Error:: get invalid RPC session ...\n"); free(buf); return -5; } else Limit = sizeof(struct tagRPCRet); if (rrpc->ret_retcode < 0 && rrpc->ret_errno) { - rpc_SetErr(rrpc->ret_errno, "Error::Server side: %d %s\n", - rrpc->ret_retcode, strerror(rrpc->ret_errno)); + rpc_SetErr(rrpc->ret_errno, "Error::Server side: retcode=%d #%d %s\n", + rrpc->ret_retcode, rrpc->ret_errno, strerror(rrpc->ret_errno)); free(buf); return -6; }