26 int myPort,
XrdOss *theSS) {
37 readOnlyredirect(true),
54 Say.
Emsg(
"RedirLocal",
"oss.localroot (replaced by xrdcmsredirlocal for localredirect) " \
55 "and xrdcmsredirlocal.localroot are undefined, define xrdcmsredirlocal.localroot");
60 Say.
Emsg(
"RedirLocal",
"oss.localroot or xrdcmsredirlocal.localroot needs to be an absolute path");
73 if ((cfgFD =
open(filename, O_RDONLY, 0)) < 0) {
77 while ((word =
Config.GetFirstWord(
true))) {
80 if (strcmp(word,
"xrdcmsredirlocal.readonlyredirect") == 0){
85 else if (strcmp(word,
"xrdcmsredirlocal.httpredirect") == 0){
90 else if (strcmp(word,
"xrdcmsredirlocal.localroot") == 0){
95 else if (strcmp(word,
"oss.localroot") == 0 &&
localroot.empty()){
136 if(strstr(EnvInfo->
Env(param),
"tried=localhost") !=
nullptr)
138 std::string newPath(path);
140 newPath =
"//" + newPath.substr(
localroot.size());
144 const std::string errText { std::string(Resp.
getErrText()) +
':' + std::to_string(Resp.
getErrInfo()) + newPath};
155 if (strncmp(dialect.c_str(),
"http", 4) == 0 && !
httpRedirect)
169 if (strncmp(dialect.c_str(),
"http", 4) != 0)
172 int urlRedirSupport = Resp.
getUCap();
174 if (!urlRedirSupport)
178 int clientLRedirSupport = Resp.
getUCap();
180 if (!clientLRedirSupport)
186 if (!(strncmp(dialect.c_str(),
"http", 4) == 0 && flags == 0x20000000))
199 std::string ppath =
"file://" +
localroot + path;
200 if (strncmp(dialect.c_str(),
"http", 4) == 0)
204 Resp.
setErrInfo(-1, ppath.substr(0, ppath.find(path)).c_str());
XrdVERSIONINFO(XrdCmsGetClient, XrdCmsRedirLocal)
XrdCmsClient * XrdCmsGetClient(XrdSysLogger *Logger, int opMode, int myPort, XrdOss *theSS)
Necessary implementation for XRootD to get the Plug-in.
int open(const char *path, int oflag,...)
virtual int Configure(const char *cfn, char *Parms, XrdOucEnv *EnvInfo)=0
virtual int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0)=0
virtual int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)=0
int Configure(const char *cfn, char *Parms, XrdOucEnv *EnvInfo)
Configure the nativeCmsFinder.
~XrdCmsRedirLocal()
Destructor.
XrdCmsClient * nativeCmsFinder
used to forward requests to CmsFinder with regular implementation
void loadConfig(const char *filename)
int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *EnvInfo)
XrdCmsRedirLocal(XrdSysLogger *Logger, int opMode, int myPort, XrdOss *theSS)
Constructor.
int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *EnvInfo)
const char * Set(const char *hSpec, int pNum=PortInSpec)
const XrdSecEntity * secEnv() const
const char * getErrText()
int setErrInfo(int code, const char *emsg)
XrdNetAddrInfo * addrInfo
Entity's connection details.
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
XrdSysLogger * logger(XrdSysLogger *lp=0)
static const int uUrlOK
ucap: Supports async responses
static const int uLclF
ucap: Client is on a private net