--- libaitrpc/src/blob.c 2012/05/16 08:10:39 1.7.2.1 +++ libaitrpc/src/blob.c 2012/05/16 08:20:26 1.7.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: blob.c,v 1.7.2.1 2012/05/16 08:10:39 misho Exp $ +* $Id: blob.c,v 1.7.2.3 2012/05/16 08:20:26 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -165,7 +165,7 @@ rpc_srv_blobMap(rpc_srv_t * __restrict srv, rpc_blob_t inline void rpc_srv_blobUnmap(rpc_blob_t * __restrict blob) { - if (blob && blob->blob_data) + if (blob && blob->blob_data) { munmap(blob->blob_data, blob->blob_len); blob->blob_data = NULL; } @@ -220,7 +220,7 @@ 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) { - len = send(cli->cli_sock, pos, ret, 0); + len = send(cli->cli_sock, pos, ret, MSG_NOSIGNAL); if (len == -1) { LOGERR; return -1; @@ -252,7 +252,7 @@ rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_ pfd.fd = cli->cli_sock; pfd.events = POLLIN | POLLPRI; for (ret = blob->blob_len, pos = blob->blob_data; ret > 0; ret -= len, pos += len) { - if ((len = poll(&pfd, 1, ((rpc_sess_t*) cli->cli_parent)->sess_timeout * 1000)) < 1 || + if ((len = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { LOGERR; return -1; @@ -268,7 +268,7 @@ rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_ return ret; } -// ------------------------------------------------------------ +/* ------------------------------------------------------------ */ /* * rpc_cli_sendBLOB() - Send BLOB to server @@ -316,7 +316,7 @@ rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, ait_val_t /* wait for reply */ pfd.fd = cli->cli_sock; pfd.events = POLLIN | POLLPRI; - if ((ret = poll(&pfd, 1, ((rpc_sess_t*) cli->cli_parent)->sess_timeout * 1000)) < 1 || + if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { if (ret) LOGERR; @@ -397,7 +397,7 @@ rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t pfd.fd = cli->cli_sock; pfd.events = POLLIN | POLLPRI; for (ret = AIT_LEN(var), pos = *data; ret > 0; ret -= len, pos += len) { - if ((len = poll(&pfd, 1, ((rpc_sess_t*) cli->cli_parent)->sess_timeout * 1000)) < 1 || + if ((len = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { LOGERR; free(*data); @@ -414,7 +414,7 @@ rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, ait_val_t } /* wait for reply */ - if ((len = poll(&pfd, 1, ((rpc_sess_t*) cli->cli_parent)->sess_timeout * 1000)) < 1 || + if ((len = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { if (len) LOGERR; @@ -488,7 +488,7 @@ rpc_cli_delBLOB(rpc_cli_t * __restrict cli, ait_val_t /* wait for reply */ pfd.fd = cli->cli_sock; pfd.events = POLLIN | POLLPRI; - if ((ret = poll(&pfd, 1, ((rpc_sess_t*) cli->cli_parent)->sess_timeout * 1000)) < 1 || + if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { if (ret) LOGERR;