diff --git a/daemon/nfs41_rpc.c b/daemon/nfs41_rpc.c index db85e1a..d6e1f4c 100644 --- a/daemon/nfs41_rpc.c +++ b/daemon/nfs41_rpc.c @@ -34,7 +34,7 @@ static enum clnt_stat send_null(CLIENT *client) { - struct timeval timeout = {10, 0}; + struct timeval timeout = {10, 100}; return clnt_call(client, 0, (xdrproc_t)xdr_void, NULL, @@ -337,7 +337,7 @@ int nfs41_send_compound( IN char *inbuf, OUT char *outbuf) { - struct timeval timeout = {90, 0}; + struct timeval timeout = {90, 100}; enum clnt_stat rpc_status; int status, count = 0, one = 1, zero = 0; uint32_t version; diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c index 1e882bf..5cb7be6 100644 --- a/libtirpc/src/clnt_vc.c +++ b/libtirpc/src/clnt_vc.c @@ -582,17 +582,20 @@ call_again: ct->reply_msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void; if (!ct->use_stored_reply_msg) { if (!xdrrec_skiprecord(xdrs)) { + if (ct->ct_error.re_status != RPC_CANTRECV) { + time(&time_now); + if (time_now - start_send >= timeout.tv_sec) { + ct->ct_error.re_status = RPC_TIMEDOUT; + goto out; + } #ifdef NO_CB_4_KRB5P - if (cl->cb_thread != INVALID_HANDLE_VALUE) + if (cl->cb_thread != INVALID_HANDLE_VALUE) #endif - release_fd_lock(ct->ct_fd, mask); - time(&time_now); - if (time_now - start_send >= timeout.tv_sec) { - ct->ct_error.re_status = RPC_TIMEDOUT; - goto out; + release_fd_lock(ct->ct_fd, mask); + SwitchToThread(); + continue; } - SwitchToThread(); - continue; + goto out; } if (!xdr_getxiddir(xdrs, &ct->reply_msg)) { if (ct->ct_error.re_status == RPC_SUCCESS) { @@ -621,6 +624,11 @@ call_again: break; } else { + time(&time_now); + if (time_now - start_send >= timeout.tv_sec) { + ct->ct_error.re_status = RPC_TIMEDOUT; + goto out; + } ct->use_stored_reply_msg = TRUE; release_fd_lock(ct->ct_fd, mask); SwitchToThread(); @@ -930,8 +938,7 @@ read_vc(ctp, buf, len) */ struct ct_data *ct = (struct ct_data *)ctp; struct pollfd fd; - int milliseconds = (int)((ct->ct_wait.tv_sec * 1000) + - (ct->ct_wait.tv_usec / 1000)); + int milliseconds = ct->ct_wait.tv_usec; if (len == 0) return (0);