Skip to content
Snippets Groups Projects
Commit bdc676d8 authored by Paul Kramp's avatar Paul Kramp Committed by Axel Naumann
Browse files

Added localredirect compatibility to TNetXNGFile


Co-authored-by: default avatarJan Knedlik <j.knedlik@gsi.de>
parent e84097f4
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,8 @@ public:
fFile(0), fUrl(0), fMode(XrdCl::OpenFlags::None), fInitCondVar(0),
fReadvIorMax(0), fReadvIovMax(0) {}
TNetXNGFile(const char *url, Option_t *mode = "", const char *title = "",
Int_t compress = 1, Int_t netopt = 0, Bool_t parallelopen = kFALSE);
Int_t compress = 1, Int_t netopt = 0, Bool_t parallelopen = kFALSE,
const char *lurl = 0);
virtual ~TNetXNGFile();
virtual void Init(Bool_t create);
......
......@@ -127,8 +127,9 @@ TNetXNGFile::TNetXNGFile(const char *url,
const char *title,
Int_t compress,
Int_t /*netopt*/,
Bool_t parallelopen) :
TFile(url, "NET", title, compress)
Bool_t parallelopen,
const char *lurl) :
TFile((lurl ? lurl : url), "NET", title, compress)
{
using namespace XrdCl;
......@@ -725,6 +726,18 @@ Bool_t TNetXNGFile::GetVectorReadLimits()
if (!fQueryReadVParams)
return kTRUE;
std::string lasturl;
fFile->GetProperty("LastURL",lasturl);
URL lrl(lasturl);
//local redirect will split vector reads into multiple local reads anyway,
// so we are fine with the default values
if(0==lrl.GetProtocol().compare("file") &&
0==lrl.GetHostId().compare("localhost")){
if (gDebug>=1)
Info("GetVectorReadLimits","Local redirect, using default values");
return kTRUE;
}
#if XrdVNUMBER >= 40000
std::string dataServerStr;
if( !fFile->GetProperty( "DataServer", dataServerStr ) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment