configurable retries... -oretries=3

git-svn-id: http://s3fs.googlecode.com/svn/trunk@82 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
rrizun 2008-02-20 04:42:38 +00:00
parent 52d6be7e20
commit 04534c156f
1 changed files with 9 additions and 2 deletions

View File

@ -174,13 +174,16 @@ public:
}
};
// -oretries=3
static int retries = 3;
/**
* @return fuse return code
*/
static int
my_curl_easy_perform(CURL* curl) {
int retries = 3;
while (retries-- > 0) {
int t = retries;
while (t-- > 0) {
CURLcode curlCode = curl_easy_perform(curl);
if (curlCode == 0)
return 0;
@ -1083,6 +1086,10 @@ my_fuse_opt_proc(void *data, const char *arg, int key, struct fuse_args *outargs
AWSSecretAccessKey = strchr(arg, '=') + 1;
return 0;
}
if (strstr(arg, "retries=") != 0) {
retries = atoi(strchr(arg, '=') + 1);
return 0;
}
if (strstr(arg, "use_cache=") != 0) {
use_cache = strchr(arg, '=') + 1;
return 0;