version 1.12.2.1, 2013/05/26 20:24:52
|
version 1.13.2.2, 2013/07/15 13:53:10
|
Line 272 rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_
|
Line 272 rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_
|
* @cli = Client instance |
* @cli = Client instance |
* @var = BLOB variable |
* @var = BLOB variable |
* @data = BLOB data |
* @data = BLOB data |
|
* @tout = BLOB live on server timeout in seconds, if =NULL default timeout |
* return: -1 error, 0 ok, 1 remote error |
* return: -1 error, 0 ok, 1 remote error |
*/ |
*/ |
int |
int |
rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t * __restrict var, void * __restrict data) | rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t * __restrict var, void * __restrict data, |
| int * __restrict tout) |
{ |
{ |
int ret, len; |
int ret, len; |
uint8_t *pos; |
uint8_t *pos; |
Line 291 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
|
Line 293 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
|
rpc_addPktSession(&hdr.hdr_session, cli->cli_parent); |
rpc_addPktSession(&hdr.hdr_session, cli->cli_parent); |
hdr.hdr_cmd = set; |
hdr.hdr_cmd = set; |
hdr.hdr_var = 0; |
hdr.hdr_var = 0; |
hdr.hdr_ret = 0; | hdr.hdr_ret = tout ? *tout : 0; |
hdr.hdr_len = htonl(AIT_LEN(var)); |
hdr.hdr_len = htonl(AIT_LEN(var)); |
|
|
/* send SET request */ |
/* send SET request */ |
Line 330 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
|
Line 332 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t
|
} |
} |
|
|
if (hdr.hdr_cmd != error) { |
if (hdr.hdr_cmd != error) { |
|
AIT_SET_BLOB(var, ntohl(hdr.hdr_var), ntohl(hdr.hdr_len)); |
|
|
if (ntohl(hdr.hdr_len) != AIT_LEN(var)) { |
if (ntohl(hdr.hdr_len) != AIT_LEN(var)) { |
|
rpc_cli_delBLOB(cli, var); |
|
AIT_NEW_BLOB(var, ntohl(hdr.hdr_len)); |
|
|
rpc_SetErr(ECANCELED, "Bad return length packet"); |
rpc_SetErr(ECANCELED, "Bad return length packet"); |
return 1; |
return 1; |
} |
} |
|
|
AIT_SET_BLOB(var, ntohl(hdr.hdr_var), ntohl(hdr.hdr_len)); |
|
} |
} |
|
|
return hdr.hdr_cmd == error; |
return hdr.hdr_cmd == error; |