Skip to content

Commit

Permalink
Merge branch 'url-path-bug' of https://github.com/alja/xrootd
Browse files Browse the repository at this point in the history
  • Loading branch information
ljanyst committed Dec 8, 2014
2 parents cd677f3 + 84a9e7b commit 66c6a41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
20 changes: 4 additions & 16 deletions src/XrdFileCache/XrdFileCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <sys/statvfs.h>

#include "XrdCl/XrdClConstants.hh"
#include "XrdCl/XrdClURL.hh"
#include "XrdSys/XrdSysPthread.hh"
#include "XrdOss/XrdOss.hh"
#include "XrdOuc/XrdOucEnv.hh"
Expand Down Expand Up @@ -99,23 +100,10 @@ void Cache::Detach(XrdOucCacheIO* io)
//______________________________________________________________________________


bool Cache::getFilePathFromURL(const char* url, std::string &result) const
void Cache::getFilePathFromURL(const char* iUrl, std::string &result) const
{
std::string path = url;
size_t split_loc = path.rfind("//");

if (split_loc == path.npos)
return false;

size_t kloc = path.rfind("?");

if (kloc == path.npos)
return false;

result = Factory::GetInstance().RefConfiguration().m_cache_dir;
result += path.substr(split_loc+1,kloc-split_loc-1);

return true;
XrdCl::URL url(iUrl);
result = Factory::GetInstance().RefConfiguration().m_cache_dir + url.GetPath();
}

//______________________________________________________________________________
Expand Down
2 changes: 1 addition & 1 deletion src/XrdFileCache/XrdFileCache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace XrdFileCache
void Detach(XrdOucCacheIO *);

//! Transfor URL to path on local disk.
bool getFilePathFromURL(const char* url, std::string& res) const;
void getFilePathFromURL(const char* url, std::string& res) const;

//! Short log alias.
XrdCl::Log* clLog() const { return XrdCl::DefaultEnv::GetLog(); }
Expand Down

0 comments on commit 66c6a41

Please sign in to comment.