From 0a233011a5715c82d08d1e4059155840d63dbca6 Mon Sep 17 00:00:00 2001 From: "mooredan@suncup.net" Date: Sat, 5 Feb 2011 01:35:18 +0000 Subject: [PATCH] potential fix for issue 148 - increase max_keys in readdir from 50 to 500 - handle the curle_couldnt_resolve_host error better - add the curl forbid reuse option git-svn-id: http://s3fs.googlecode.com/svn/trunk@308 df820570-a93a-0410-bd06-b72b767a4274 --- configure.ac | 2 +- src/s3fs.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9a8f7ba..12cad58 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(s3fs, 1.35) +AC_INIT(s3fs, 1.36) AC_CANONICAL_SYSTEM diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 2afc481..ae5dc26 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -189,6 +189,7 @@ CURL *create_curl_handle(void) { curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 0); curl_easy_setopt(curl_handle, CURLOPT_PROGRESSFUNCTION, my_curl_progress); curl_easy_setopt(curl_handle, CURLOPT_PROGRESSDATA, curl_handle); + curl_easy_setopt(curl_handle, CURLOPT_FORBID_REUSE, 1); now = time(0); curl_times[curl_handle] = now; curl_progress[curl_handle] = progress_t(-1, -1); @@ -674,6 +675,11 @@ static int my_curl_easy_perform(CURL* curl, BodyStruct* body = NULL, FILE* f = 0 sleep(2); break; + case CURLE_COULDNT_RESOLVE_HOST: + syslog(LOG_ERR, "### CURLE_COULDNT_RESOLVE_HOST"); + sleep(2); + break; + case CURLE_COULDNT_CONNECT: syslog(LOG_ERR, "### CURLE_COULDNT_CONNECT"); sleep(4); @@ -3174,7 +3180,7 @@ static int s3fs_readdir( if (NextMarker.size() > 0) query += "&marker=" + urlEncode(NextMarker); - query += "&max-keys=50"; + query += "&max-keys=500"; string url = host + resource + "?" + query;