@pkramp commented on this pull request.


In src/XrdCms/XrdCmsRedirLocal.cc:

> @@ -113,6 +118,31 @@ int XrdCmsRedirLocal::Locate(XrdOucErrInfo &Resp, const char *path, int flags,
                         XrdOucEnv *EnvInfo) {
   int rcode = 0;
   if (nativeCmsFinder) {
+    // check if path contains localroot to know if potential redirection loop
+    // is happening. If yes, remove localroot from path, then rerun default
+    // locate with regular path and return to client
+    // localroot must be larger than 1 to avoid always being triggered by "/"
+    if (localroot.size() > 1 && strncmp(path, localroot.c_str(), localroot.size()) == 0)
+    {
+      // now check if localhost was tried before, to make sure we're handling
+      // the redirection loop
+      int param = 0; // need it to get Env
+      std::string envInfo(EnvInfo->Env(param)); // get already tried hosts
+      std::string searchPattern = "&tried=localhost"; //search for this pattern

Thanks, corrected. But we're now searching for "tried=localhost" in the full envInfo. Otherwise, it might be missed, if other params are passed first.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/pull/1523#discussion_r740926058", "url": "https://github.com/xrootd/xrootd/pull/1523#discussion_r740926058", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1