Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XrdPfc] Pass LFN, not url to PFC decision plugin. #698

Merged
merged 1 commit into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/XrdFileCache/XrdFileCache.cc
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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