version 1.1.2.16, 2011/05/02 23:07:55
|
version 1.2.4.1, 2011/08/19 09:32:38
|
Line 60 rpc_srv_blobCreate(rpc_srv_t * __restrict srv, int len
|
Line 60 rpc_srv_blobCreate(rpc_srv_t * __restrict srv, int len
|
int f; |
int f; |
u_int rnd; |
u_int rnd; |
|
|
|
#ifdef HAVE_SRANDOMDEV |
srandomdev(); |
srandomdev(); |
|
#else |
|
time_t tim; |
|
|
|
srandom((time(&tim) ^ getpid())); |
|
#endif |
again: |
again: |
rnd = random() % UINT_MAX; |
rnd = random() % UINT_MAX; |
|
|
Line 210 rpc_srv_sendBLOB(rpc_cli_t * __restrict cli, rpc_blob_
|
Line 216 rpc_srv_sendBLOB(rpc_cli_t * __restrict cli, rpc_blob_
|
} |
} |
|
|
for (ret = blob->blob_len, pos = blob->blob_data; ret > 0; ret -= len, pos += len) |
for (ret = blob->blob_len, pos = blob->blob_data; ret > 0; ret -= len, pos += len) |
if ((len = send(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret, 0)) == -1) { | if ((len = write(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret)) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |
Line 246 rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_
|
Line 252 rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_
|
return -1; |
return -1; |
} |
} |
|
|
if ((len = recv(cli->cli_sock, pos, BLOBSIZ, 0)) == -1) { | if ((len = read(cli->cli_sock, pos, BLOBSIZ)) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |
Line 283 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 289 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
hdr.hdr_var = 0; |
hdr.hdr_var = 0; |
hdr.hdr_ret = 0; |
hdr.hdr_ret = 0; |
hdr.hdr_len = var->val_len; |
hdr.hdr_len = var->val_len; |
if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { | if (write(cli->cli_sock, &hdr, sizeof hdr) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |
|
|
for (ret = var->val_len, pos = data; ret > 0; ret -= len, pos += len) |
for (ret = var->val_len, pos = data; ret > 0; ret -= len, pos += len) |
if ((len = send(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret, 0)) == -1) { | if ((len = write(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret)) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |
Line 304 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 310 rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
rpc_SetErr(ETIMEDOUT, "Error:: Timeout reached! Server not responde ...\n"); |
rpc_SetErr(ETIMEDOUT, "Error:: Timeout reached! Server not responde ...\n"); |
return -1; |
return -1; |
} |
} |
if (recv(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { | if (read(cli->cli_sock, &hdr, sizeof hdr) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |
Line 353 rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 359 rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
hdr.hdr_var = (uint32_t) RPC_GET_BLOB(var); |
hdr.hdr_var = (uint32_t) RPC_GET_BLOB(var); |
hdr.hdr_ret = 0; |
hdr.hdr_ret = 0; |
hdr.hdr_len = 0; |
hdr.hdr_len = 0; |
if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { | if (write(cli->cli_sock, &hdr, sizeof hdr) == -1) { |
LOGERR; |
LOGERR; |
free(*data); |
free(*data); |
*data = NULL; |
*data = NULL; |
Line 371 rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 377 rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
return -1; |
return -1; |
} |
} |
|
|
if ((len = recv(cli->cli_sock, pos, BLOBSIZ, 0)) == -1) { | if ((len = read(cli->cli_sock, pos, BLOBSIZ)) == -1) { |
LOGERR; |
LOGERR; |
free(*data); |
free(*data); |
*data = NULL; |
*data = NULL; |
Line 393 rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 399 rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
*data = NULL; |
*data = NULL; |
return -1; |
return -1; |
} |
} |
if (recv(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { | if (read(cli->cli_sock, &hdr, sizeof hdr) == -1) { |
LOGERR; |
LOGERR; |
free(*data); |
free(*data); |
*data = NULL; |
*data = NULL; |
Line 434 rpc_cli_delBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 440 rpc_cli_delBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
hdr.hdr_var = (uint32_t) RPC_GET_BLOB(var); |
hdr.hdr_var = (uint32_t) RPC_GET_BLOB(var); |
hdr.hdr_ret = 0; |
hdr.hdr_ret = 0; |
hdr.hdr_len = 0; |
hdr.hdr_len = 0; |
if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { | if (write(cli->cli_sock, &hdr, sizeof hdr) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |
Line 449 rpc_cli_delBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
Line 455 rpc_cli_delBLOB(rpc_cli_t * __restrict cli, rpc_val_t
|
rpc_SetErr(ETIMEDOUT, "Error:: Timeout reached! Server not responde ...\n"); |
rpc_SetErr(ETIMEDOUT, "Error:: Timeout reached! Server not responde ...\n"); |
return -1; |
return -1; |
} |
} |
if (recv(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { | if (read(cli->cli_sock, &hdr, sizeof hdr) == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} |
} |