diff --git a/src/XrdFileCache/XrdFileCache.cc b/src/XrdFileCache/XrdFileCache.cc index 946e9220bd3..576502d813a 100644 --- a/src/XrdFileCache/XrdFileCache.cc +++ b/src/XrdFileCache/XrdFileCache.cc @@ -124,7 +124,8 @@ bool Cache::Decide(XrdOucCacheIO* io) { if (! m_decisionpoints.empty()) { - std::string filename = io->Path(); + XrdCl::URL url(io->Path()); + std::string filename = url.GetPath(); std::vector::const_iterator it; for (it = m_decisionpoints.begin(); it != m_decisionpoints.end(); ++it) { diff --git a/src/XrdFileCache/XrdFileCacheBlacklistDecision.cc b/src/XrdFileCache/XrdFileCacheBlacklistDecision.cc index 5a5a2e9d3c2..ae70d23897c 100644 --- a/src/XrdFileCache/XrdFileCacheBlacklistDecision.cc +++ b/src/XrdFileCache/XrdFileCacheBlacklistDecision.cc @@ -31,31 +31,12 @@ class BlacklistDecision : public XrdFileCache::Decision //---------------------------------------------------------------------------- public: -virtual bool Decide(const std::string & url, XrdOss &) const +virtual bool Decide(const std::string & lfn, XrdOss &) const { - size_t slashslash = url.find("//"); - const char *fname = url.c_str(); - if (slashslash != std::string::npos) - { - fname += slashslash+2; - fname = strchr(fname, '/'); - if (! fname) {return true; } - } - std::string url_path = fname; - size_t question = url_path.find("?"); - if (question != std::string::npos) - { - url_path[question] = '\0'; - fname = url_path.c_str(); - } - if ((strlen(fname) > 1) && (fname[0] == '/') && (fname[1] == '/')) - { - fname++; - } - //m_log.Emsg("BlacklistDecide", "Deciding whether to cache file", fname); + //m_log.Emsg("BlacklistDecide", "Deciding whether to cache file", url.c_str()); for (std::vector::const_iterator it = m_blacklist.begin(); it != m_blacklist.end(); it++) { - if (! fnmatch(it->c_str(), fname, FNM_PATHNAME)) + if (! fnmatch(it->c_str(), lfn.c_str(), FNM_PATHNAME)) { //m_log.Emsg("BlacklistDecide", "Not caching file as it matches blacklist entry", it->c_str()); return false;