Skip to content
Snippets Groups Projects
Commit a417a2f9 authored by Pere Mato Vila's avatar Pere Mato Vila
Browse files

Applied patch in https://sft.its.cern.ch/jira/browse/ROOT-6294 Not really...

Applied patch in https://sft.its.cern.ch/jira/browse/ROOT-6294  Not really tested because we have no test associated to this plugin.
parent 226179e2
No related branches found
No related tags found
No related merge requests found
......@@ -586,7 +586,8 @@ if(builtin_xrootd)
XROOTD
URL http://xrootd.org/download/v${xrootd_version}/xrootd-${xrootd_version}.tar.gz
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
CMAKE_ARGS -DENABLE_PERL=FALSE
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
......
......@@ -23,6 +23,7 @@
#include "TSystem.h"
#include "TCollection.h"
#include <set>
#ifndef __CINT__
#include <XrdCl/XrdClXRootDResponses.hh>
......@@ -38,6 +39,7 @@ namespace XrdCl {
class TNetXNGSystem: public TSystem {
private:
std::set<void*> fDirPtrs;
#ifndef __CINT__
private:
XrdCl::URL *fUrl; // URL of this TSystem
......
......@@ -96,6 +96,7 @@ void* TNetXNGSystem::OpenDirectory(const char *dir)
using namespace XrdCl;
DirectoryInfo *dirInfo = new DirectoryInfo(dir);
fDirPtrs.insert( (void*)dirInfo );
return (void *) dirInfo;
}
......@@ -126,6 +127,7 @@ void TNetXNGSystem::FreeDirectory(void *dirp)
//
// param dirp: the pointer to the directory to be freed
fDirPtrs.erase( dirp );
delete (DirectoryInfo *) dirp;
}
......@@ -224,27 +226,32 @@ Bool_t TNetXNGSystem::ConsistentWith(const char *path, void *dirptr)
using namespace XrdCl;
// Standard check: only the protocol part of 'path' is required to match
Bool_t checkstd = TSystem::ConsistentWith(path, dirptr);
if (!checkstd)
return kFALSE;
URL url(path);
Bool_t checknet = path ? kFALSE : kTRUE;
if (gDebug > 1)
Info("ConsistentWith", "fUser:'%s' (%s), fHost:'%s' (%s), fPort:%d (%d)",
fUrl->GetUserName().c_str(), url.GetUserName().c_str(),
fUrl->GetHostName().c_str(), url.GetHostName().c_str(),
fUrl->GetPort(), url.GetPort());
if( path )
{
URL url(path);
if( gDebug > 1 )
Info("ConsistentWith", "Protocol: '%s' (%s), Username: '%s' (%s), "
"Password: '%s' (%s), Hostname: '%s' (%s), Port: %d (%d)",
fUrl->GetProtocol().c_str(), url.GetProtocol().c_str(),
fUrl->GetUserName().c_str(), url.GetUserName().c_str(),
fUrl->GetPassword().c_str(), url.GetPassword().c_str(),
fUrl->GetHostName().c_str(), url.GetHostName().c_str(),
fUrl->GetPort(), url.GetPort());
// Require match of protocol, user, password, host and port
if( fUrl->GetProtocol() == url.GetProtocol() &&
fUrl->GetUserName() == url.GetUserName() &&
fUrl->GetPassword() == url.GetPassword() &&
fUrl->GetHostName() == url.GetHostName() &&
fUrl->GetPort() == url.GetPort())
return kTRUE;
}
// Require match of 'user' and 'host'
if (fUrl->GetUserName() == url.GetUserName()
&& fUrl->GetHostName() == url.GetHostName()
&& fUrl->GetPort() == url.GetPort())
checknet = kTRUE;
if( dirptr )
return fDirPtrs.find( dirptr ) != fDirPtrs.end();
return (checkstd && checknet);
return kFALSE;
}
//______________________________________________________________________________
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment