version 1.5.2.2, 2011/09/07 09:10:55
|
version 1.5.2.3, 2011/09/07 09:22:15
|
Line 314 rpc_cli_execCall(rpc_cli_t *cli, const char *csModule,
|
Line 314 rpc_cli_execCall(rpc_cli_t *cli, const char *csModule,
|
struct tagRPCRet *rrpc = NULL; |
struct tagRPCRet *rrpc = NULL; |
int ret = 0, Limit = 0; |
int ret = 0, Limit = 0; |
struct timeval tv = { DEF_RPC_TIMEOUT, 0 }; |
struct timeval tv = { DEF_RPC_TIMEOUT, 0 }; |
|
uint16_t tag; |
|
uint32_t hash; |
|
|
if (!cli || !csFunc) { |
if (!cli || !csFunc) { |
rpc_SetErr(EINVAL, "Error:: Can`t execute call because parameter is null or invalid!\n"); |
rpc_SetErr(EINVAL, "Error:: Can`t execute call because parameter is null or invalid!\n"); |
Line 340 rpc_cli_execCall(rpc_cli_t *cli, const char *csModule,
|
Line 342 rpc_cli_execCall(rpc_cli_t *cli, const char *csModule,
|
rpc = (struct tagRPCCall*) buf; |
rpc = (struct tagRPCCall*) buf; |
rpc_addPktSession(&rpc->call_session, cli->cli_parent); |
rpc_addPktSession(&rpc->call_session, cli->cli_parent); |
rpc->call_argc = htons(in_vars ? io_arraySize(in_vars) : 0); |
rpc->call_argc = htons(in_vars ? io_arraySize(in_vars) : 0); |
rpc->call_tag = htons(crcFletcher16((u_short*) str, sizeof str / 2)); | rpc->call_tag = tag = htons(crcFletcher16((u_short*) str, sizeof str / 2)); |
rpc->call_hash = htonl(hash_fnv((char*) str, sizeof str)); | rpc->call_hash = hash = htonl(hash_fnv((char*) str, sizeof str)); |
Limit = sizeof(struct tagRPCCall); |
Limit = sizeof(struct tagRPCCall); |
|
|
if (in_vars && io_arraySize(in_vars)) { |
if (in_vars && io_arraySize(in_vars)) { |
Line 402 rpc_cli_execCall(rpc_cli_t *cli, const char *csModule,
|
Line 404 rpc_cli_execCall(rpc_cli_t *cli, const char *csModule,
|
return -5; |
return -5; |
} else |
} else |
Limit = sizeof(struct tagRPCRet); |
Limit = sizeof(struct tagRPCRet); |
|
if (rrpc->ret_tag != tag || rrpc->ret_hash != hash) { |
|
printf("tag=%x/%x hash=%x/%x\n", rrpc->ret_tag, tag, rrpc->ret_hash, hash); |
|
rpc_SetErr(ERPCMISMATCH, "Error:: get wrong RPC reply ...\n"); |
|
free(buf); |
|
return -5; |
|
} |
if (ntohl(rrpc->ret_retcode) < 0 && ntohl(rrpc->ret_errno)) { |
if (ntohl(rrpc->ret_retcode) < 0 && ntohl(rrpc->ret_errno)) { |
rpc_SetErr(ntohl(rrpc->ret_errno), "Error::Server side: retcode=%d #%d %s\n", |
rpc_SetErr(ntohl(rrpc->ret_errno), "Error::Server side: retcode=%d #%d %s\n", |
ntohl(rrpc->ret_retcode), ntohl(rrpc->ret_errno), |
ntohl(rrpc->ret_retcode), ntohl(rrpc->ret_errno), |