diff --git a/src/XrdXrootd/XrdXrootdConfig.cc b/src/XrdXrootd/XrdXrootdConfig.cc index 73328ced8bc..4ead31ff388 100644 --- a/src/XrdXrootd/XrdXrootdConfig.cc +++ b/src/XrdXrootd/XrdXrootdConfig.cc @@ -1568,7 +1568,8 @@ int XrdXrootdProtocol::xred(XrdOucStream &Config) {"rm", RD_rm}, {"rmdir", RD_rmdir}, {"stat", RD_stat}, - {"trunc", RD_trunc} + {"trunc", RD_trunc}, + {"write", RD_open2} }; static const int rHLen = 264; char rHost[2][rHLen], *hP[2], *val; diff --git a/src/XrdXrootd/XrdXrootdXeq.cc b/src/XrdXrootd/XrdXrootdXeq.cc index ff1a4f855ac..6e5a0d33a6b 100644 --- a/src/XrdXrootd/XrdXrootdXeq.cc +++ b/src/XrdXrootd/XrdXrootdXeq.cc @@ -1392,6 +1392,7 @@ int XrdXrootdProtocol::do_Open() mode = (int)ntohs(Request.open.mode); opts = (int)ntohs(Request.open.options); + // Map the mode and options // mode = mapMode(mode) | S_IRUSR | S_IWUSR; usage = 'r'; @@ -1458,15 +1459,28 @@ int XrdXrootdProtocol::do_Open() // doDig = (digFS && SFS_LCLPATH(fn)); -// Validate the path and then check if static redirection applies +// Validate the path/req type and then check if static redirection applies // - if (doDig) {popt = XROOTDXP_NOLK; opC = 0;} - else {int ropt; - if (!(popt = Squash(fn))) return vpEmsg("Opening", fn); - if (Route[RD_open1].Host[rdType] && (ropt = RPList.Validate(fn))) - return Response.Send(kXR_redirect, Route[ropt].Port[rdType], - Route[ropt].Host[rdType]); - } + if (doDig) + { + popt = XROOTDXP_NOLK; opC = 0; + } + else + { + int ropt = -1; + if (!(popt = Squash(fn))) return vpEmsg("Opening", fn); + + if (Route[RD_open1].Host[rdType]) + ropt = RPList.Validate(fn); + else + if (Route[RD_open2].Host[rdType] && ('w' == usage || strchr(op, 'd'))) + ropt = RD_open2; + if (ropt >= 0) + return Response.Send( + kXR_redirect, Route[ropt].Port[rdType], + Route[ropt].Host[rdType] + ); + } // Add the multi-write option if this path supports it //