[libtircp] adding timeout on async recv
once libtirpc blocking recv was changed to a polling receive, we no longer had a timeout mechanims on waiting for a reply. solution: save a timestamp before the recv call, on each async recv return check if the time lapsed does not exceed the timeout value. when timeout is reach, return TIMEDOUT rpc error.
This commit is contained in:
parent
d83fece068
commit
b6beb6f2a9
2 changed files with 10 additions and 2 deletions
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
static enum clnt_stat send_null(CLIENT *client)
|
||||
{
|
||||
struct timeval timeout = {0, 100};
|
||||
struct timeval timeout = {10, 0};
|
||||
|
||||
return clnt_call(client, 0,
|
||||
(xdrproc_t)xdr_void, NULL,
|
||||
|
|
@ -306,7 +306,7 @@ int nfs41_send_compound(
|
|||
IN char *inbuf,
|
||||
OUT char *outbuf)
|
||||
{
|
||||
struct timeval timeout = {0, 100};
|
||||
struct timeval timeout = {90, 0};
|
||||
enum clnt_stat rpc_status;
|
||||
int status, count = 0, one = 1, zero = 0;
|
||||
uint32_t version;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue