nfs4: Use default request timeout if FileSystem not given
This commit is contained in:
@@ -38,15 +38,17 @@ Request::_SendUDP(Cookie* cookie)
|
|||||||
if (cookie != NULL)
|
if (cookie != NULL)
|
||||||
cookie->RegisterRequest(rpc);
|
cookie->RegisterRequest(rpc);
|
||||||
|
|
||||||
|
int requestTimeout = sSecToBigTime(60);
|
||||||
int retryLimit = 0;
|
int retryLimit = 0;
|
||||||
bool hard = true;
|
bool hard = true;
|
||||||
|
|
||||||
if (fFileSystem != NULL) {
|
if (fFileSystem != NULL) {
|
||||||
|
requestTimeout = fFileSystem->GetConfiguration().fRequestTimeout;
|
||||||
retryLimit = fFileSystem->GetConfiguration().fRetryLimit;
|
retryLimit = fFileSystem->GetConfiguration().fRetryLimit;
|
||||||
hard = fFileSystem->GetConfiguration().fHard;
|
hard = fFileSystem->GetConfiguration().fHard;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = fServer->WaitCall(rpc,
|
result = fServer->WaitCall(rpc, requestTimeout);
|
||||||
fFileSystem->GetConfiguration().fRequestTimeout);
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
int attempts = 1;
|
int attempts = 1;
|
||||||
while (result != B_OK && (hard || attempts++ < retryLimit)) {
|
while (result != B_OK && (hard || attempts++ < retryLimit)) {
|
||||||
@@ -57,8 +59,7 @@ Request::_SendUDP(Cookie* cookie)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = fServer->WaitCall(rpc,
|
result = fServer->WaitCall(rpc, requestTimeout);
|
||||||
fFileSystem->GetConfiguration().fRequestTimeout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
@@ -95,10 +96,12 @@ Request::_SendTCP(Cookie* cookie)
|
|||||||
status_t result;
|
status_t result;
|
||||||
int attempts = 0;
|
int attempts = 0;
|
||||||
|
|
||||||
|
int requestTimeout = sSecToBigTime(60);
|
||||||
int retryLimit = 0;
|
int retryLimit = 0;
|
||||||
bool hard = true;
|
bool hard = true;
|
||||||
|
|
||||||
if (fFileSystem != NULL) {
|
if (fFileSystem != NULL) {
|
||||||
|
requestTimeout = fFileSystem->GetConfiguration().fRequestTimeout;
|
||||||
retryLimit = fFileSystem->GetConfiguration().fRetryLimit;
|
retryLimit = fFileSystem->GetConfiguration().fRetryLimit;
|
||||||
hard = fFileSystem->GetConfiguration().fHard;
|
hard = fFileSystem->GetConfiguration().fHard;
|
||||||
}
|
}
|
||||||
@@ -115,8 +118,7 @@ Request::_SendTCP(Cookie* cookie)
|
|||||||
if (cookie != NULL)
|
if (cookie != NULL)
|
||||||
cookie->RegisterRequest(rpc);
|
cookie->RegisterRequest(rpc);
|
||||||
|
|
||||||
result = fServer->WaitCall(rpc,
|
result = fServer->WaitCall(rpc, requestTimeout);
|
||||||
fFileSystem->GetConfiguration().fRequestTimeout);
|
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
if (cookie != NULL)
|
if (cookie != NULL)
|
||||||
cookie->UnregisterRequest(rpc);
|
cookie->UnregisterRequest(rpc);
|
||||||
|
|||||||
Reference in New Issue
Block a user