Skip to content

Commit

Permalink
Pass LFN, not url to PFC decision plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
osschar committed May 2, 2018
1 parent e3550ce commit e66d331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
3 changes: 2 additions & 1 deletion src/XrdFileCache/XrdFileCache.cc
Expand Up @@ -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<Decision*>::const_iterator it;
for (it = m_decisionpoints.begin(); it != m_decisionpoints.end(); ++it)
{
Expand Down
25 changes: 3 additions & 22 deletions src/XrdFileCache/XrdFileCacheBlacklistDecision.cc
Expand Up @@ -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<std::string>::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;
Expand Down

0 comments on commit e66d331

Please sign in to comment.