diff --git a/configure.ac b/configure.ac index ec8d395..92bd4d6 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.38) +AC_INIT(s3fs, 1.39) AC_CANONICAL_SYSTEM diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 6ad2926..9092b88 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -3276,7 +3276,19 @@ static int s3fs_readdir( } } - if (Key.size() > 0) { + bool in_stat_cache = false; + pthread_mutex_lock(&stat_cache_lock); + stat_cache_t::iterator iter = stat_cache.find("/" + Key); + if(iter != stat_cache.end()) { + // in stat cache, skip http request + if(filler(buf, mybasename(Key).c_str(), 0, 0)) + break; + + in_stat_cache = true; + } + pthread_mutex_unlock(&stat_cache_lock); + + if (Key.size() > 0 && !in_stat_cache) { if (filler(buf, mybasename(Key).c_str(), 0, 0)) { break; }