XRootD
XrdXrootdProtocol Class Reference

#include <XrdXrootdProtocol.hh>

+ Inheritance diagram for XrdXrootdProtocol:
+ Collaboration diagram for XrdXrootdProtocol:

Classes

struct  GetDataCtl
 
union  GetDataCtl.__unnamed192__
 
union  GetDataCtl.__unnamed194__
 
struct  RC_Table
 
struct  RD_Table
 

Public Member Functions

 XrdXrootdProtocol ()
 
 ~XrdXrootdProtocol ()
 
void aioUpdate (int val)
 
void aioUpdReq (int val)
 
XrdSfsXioHandle Claim (const char *buff, int datasz, int minasz=0) override
 
int do_WriteSpan ()
 
void DoIt () override
 
int getData (gdCallBack *gdcbP, const char *dtype, char *buff, int blen)
 
int getData (gdCallBack *gdcbP, const char *dtype, struct iovec *iov, int iovn)
 
int getDump (const char *dtype, int dlen)
 
int getPathID ()
 
XrdProtocolMatch (XrdLink *lp) override
 
XrdXrootdProtocol operator= (const XrdXrootdProtocol &rhs)=delete
 
int Process (XrdLink *lp) override
 
int Process2 ()
 
int ProcSig ()
 
void Recycle (XrdLink *lp, int consec, const char *reason) override
 
int SendFile (int fildes) override
 
int SendFile (XrdOucSFVec *sfvec, int sfvnum) override
 
void SetFD (int fildes) override
 
int Stats (char *buff, int blen, int do_sync=0) override
 
void StreamNOP ()
 
XrdSfsXioHandle Swap (const char *buff, XrdSfsXioHandle h=0) override
 
XrdXrootdProtocolVerifyStream (int &rc, int pID, bool lok=true)
 
- Public Member Functions inherited from XrdProtocol
 XrdProtocol (const char *jname)
 
virtual ~XrdProtocol ()
 
- Public Member Functions inherited from XrdJob
 XrdJob (const char *desc="")
 
virtual ~XrdJob ()
 
- Public Member Functions inherited from XrdXrootd::gdCallBack
 gdCallBack ()
 
virtual ~gdCallBack ()
 
virtual void gdFail ()
 
- Public Member Functions inherited from XrdSfsDio
 XrdSfsDio ()
 Constructor and destructor. More...
 
virtual ~XrdSfsDio ()
 
- Public Member Functions inherited from XrdSfsXio
 XrdSfsXio (XrdSfsXioImpl &xioimpl)
 
virtual ~XrdSfsXio ()
 Constructor and destructor. More...
 

Static Public Member Functions

static char * Buffer (XrdSfsXioHandle h, int *bsz)
 
static int Configure (char *parms, XrdProtocol_Config *pi)
 
static void Reclaim (XrdSfsXioHandle h)
 
- Static Public Member Functions inherited from XrdSfsXio
static char * Buffer (XrdSfsXioHandle theHand, int *buffsz=0)
 
static void Reclaim (XrdSfsXioHandle theHand)
 

Static Public Attributes

static bool as_aioOK = true
 
static bool as_force = false
 
static int as_maxperlnk = 8
 
static int as_maxperreq = 8
 
static int as_maxpersrv = 4096
 
static int as_maxstalls = 4
 
static int as_miniosz = 98304
 
static int as_minsfsz = 8192
 
static bool as_nosf = false
 
static short as_okstutter = 1
 
static int as_seghalf = 32768
 
static int as_segsize = 65536
 
static bool as_syncw = false
 
static short as_timeout = 45
 
static const int maxStreams = 16
 

Protected Member Functions

void MonAuth ()
 
bool RequestClose ()
 
int SetSF (kXR_char *fhandle, bool seton=false)
 

Static Protected Member Functions

static bool CloseRequestCb (void *cbarg)
 
static unsigned int getSID ()
 

Protected Attributes

bool ableTLS
 
char * AppName
 
XrdBufferargp
 
XrdSecProtocolAuthProt
 
XrdSysSemaphoreboundRecycle
 
unsigned char CapVer
 
XrdSecEntityClient
 
int clientPV
 
int clientRN
 
bool CloseRequested
 
int cumReadP
 
int cumReads
 
int cumReadV
 
int cumSegsV
 
int cumSegsW
 
int cumWrites
 
int cumWritV
 
char doTLS
 
XrdSysCondVar2endNote
 
XrdSecEntity Entity
 
XrdXrootdFileTableFTab
 
struct XrdXrootdProtocol::GetDataCtl gdCtl
 
int halfBSize
 
int hcNext
 
int hcNow
 
int hcPrev
 
XrdXrootd::IOParms IO
 
bool isActive
 
bool isLinkWT
 
bool isNOP
 
bool isTLS
 
XrdLinkLink
 
RAtomic_int linkAioReq
 
XrdXrootdMonitor::User Monitor
 
int myBlast
 
int myBlen
 
char * myBuff
 
unsigned int mySID
 
int myStalls
 
bool newPio
 
int numFiles
 
int numReadP
 
int numReads
 
int numReadV
 
int numSegsV
 
int numSegsW
 
int numWrites
 
int numWritV
 
short PathID
 
XrdXrootdPgwCtlpgwCtl
 
XrdXrootdPiopioFirst
 
XrdXrootdPiopioFree
 
XrdXrootdPiopioLast
 
bool pmDone
 
XrdNetPMark::HandlepmHandle
 
int PrepareCount
 
XrdSecProtectProtect
 
short rdType
 
XrdXrootdReqID ReqID
 
ClientRequest Request
 
char reserved [3]
 
XrdXrootdResponse Response
 
int(XrdXrootdProtocol::* Resume )()
 
int(XrdXrootdProtocol::* ResumePio )()
 
XrdSysSemaphorereTry
 
unsigned char rvSeq
 
char sigBuff [64]
 
bool sigHere
 
bool sigNeed
 
bool sigRead
 
SecurityRequest sigReq
 
ClientRequest sigReq2Ver
 
bool sigWarn
 
char Status
 
XrdXrootdProtocolStream [maxStreams]
 
XrdSysMutex streamMutex
 
long long totReadP
 
XrdSysMutex unbindMutex
 
XrdXrootdWVInfowvInfo
 
unsigned char wvSeq
 

Static Protected Attributes

static XrdNetSocketAdminSock = 0
 
static XrdBuffManagerBPool
 
static XrdSecServiceCIA = 0
 
static bool CL_Redir = false
 
static XrdSecProtectorDHS = 0
 
static XrdSfsFileSystemdigFS = 0
 
static XrdSysErroreDest = XrdXrootd::eLog
 
static uint64_t fsFeatures = 0
 
static int hailWait
 
static int hcMax = 28657
 
static bool isProxy = false
 
static char isRedir = 0
 
static char JobCKCGI =0
 
static XrdXrootdJobJobCKS = 0
 
static char * JobCKT = 0
 
static XrdOucTListJobCKTLST = 0
 
static char JobLCL = 0
 
static time_t keepT = 86400
 
static bool LimitError = true
 
static XrdXrootdFileLockLocker
 
static int maxBuffsz
 
static const int maxPio = 4
 
static int maxReadv_ior
 
static int maxTransz = 262144
 
static const char * myCName = 0
 
static int myCNlen = 0
 
static gid_t myGID = 0
 
static const char * myGName = "?"
 
static int myGNLen = 1
 
static const char * myInst = 0
 
static int myPID = static_cast<int>(getpid())
 
static int myRole = 0
 
static int myRolf = 0
 
static uid_t myUID = 0
 
static const char * myUName = "?"
 
static int myUNLen = 1
 
static char * Notify = 0
 
static bool OD_Bypass = false
 
static bool OD_Redir = false
 
static int OD_Stall = 33
 
static XrdSfsFileSystemosFS
 
static XrdNetPMarkPMark = 0
 
static int Port
 
static bool PrepareAlt = false
 
static int PrepareLimit = -1
 
static XrdOucReqIDPrepID = 0
 
static int readWait
 
static int redirIPHold = 8*60*60
 
static XrdXrootdRedirPIRedirPI = 0
 
static const char Req_TLSData = 0x01
 
static const char Req_TLSGPFile = 0x02
 
static const char Req_TLSLogin = 0x04
 
static const char Req_TLSSess = 0x08
 
static const char Req_TLSTPC = 0x10
 
static struct XrdXrootdProtocol::RD_Table Route [RD_Num]
 
static struct XrdXrootdProtocol::RC_Table RouteClient
 
static XrdXrootdXPath RPList
 
static XrdXrootdXPath RQList
 
static int RQLxist = 0
 
static XrdSchedulerSched
 
static XrdXrootdStatsSI
 
static RAtomic_int srvrAioOps = {0}
 
static char tlsCap = 0
 
static XrdTlsContexttlsCtx = 0
 
static char tlsNot = 0
 
static int tlsPort = 0
 
static const char * TraceID = "Protocol"
 
static int usxMaxNsz = kXR_faMaxNlen
 
static int usxMaxVsz = kXR_faMaxVlen
 
static char * usxParms = 0
 
static int Window
 
static XrdXrootdXPath XPList
 

Friends

class XrdXrootdAdmin
 

Additional Inherited Members

- Public Attributes inherited from XrdJob
const char * Comment
 
XrdJobNextJob
 

Detailed Description

Definition at line 157 of file XrdXrootdProtocol.hh.


Class Documentation

◆ XrdXrootdProtocol::GetDataCtl.__unnamed192__

union XrdXrootdProtocol::GetDataCtl.__unnamed192__

Definition at line 562 of file XrdXrootdProtocol.hh.

+ Collaboration diagram for XrdXrootdProtocol::GetDataCtl.__unnamed192__:
Class Members
int BuffLen
int DumpLen
int iovAdj

◆ XrdXrootdProtocol::GetDataCtl.__unnamed194__

union XrdXrootdProtocol::GetDataCtl.__unnamed194__

Definition at line 570 of file XrdXrootdProtocol.hh.

+ Collaboration diagram for XrdXrootdProtocol::GetDataCtl.__unnamed194__:
Class Members
char * Buffer
struct iovec * iovVec

◆ XrdXrootdProtocol::RC_Table

struct XrdXrootdProtocol::RC_Table

Definition at line 454 of file XrdXrootdProtocol.hh.

+ Collaboration diagram for XrdXrootdProtocol::RC_Table:
Class Members
char * Domain[4]
short DomCnt
bool lclDom
bool pvtIP

◆ XrdXrootdProtocol::RD_Table

struct XrdXrootdProtocol::RD_Table

Definition at line 450 of file XrdXrootdProtocol.hh.

+ Collaboration diagram for XrdXrootdProtocol::RD_Table:
Class Members
char * Host[2]
unsigned short Port[2]
short RDSz[2]

Constructor & Destructor Documentation

◆ XrdXrootdProtocol()

XrdXrootdProtocol::XrdXrootdProtocol ( )

Definition at line 259 of file XrdXrootdProtocol.cc.

260  : XrdProtocol("xroot protocol handler"),
261  XrdSfsXio(SfsXioImpl),
262  ProtLink(this), Entity(0), AppName(0)
263 {
264  Reset();
265 }
XrdProtocol(const char *jname)
Definition: XrdProtocol.hh:156
XrdSfsXio(XrdSfsXioImpl &xioimpl)
Definition: XrdSfsXio.cc:52

Referenced by Match().

+ Here is the caller graph for this function:

◆ ~XrdXrootdProtocol()

XrdXrootdProtocol::~XrdXrootdProtocol ( )
inline

Definition at line 215 of file XrdXrootdProtocol.hh.

215 {Cleanup();}

Member Function Documentation

◆ aioUpdate()

void XrdXrootdProtocol::aioUpdate ( int  val)
inline

Definition at line 163 of file XrdXrootdProtocol.hh.

163 {srvrAioOps += val;}
static RAtomic_int srvrAioOps

References srvrAioOps.

Referenced by XrdXrootdAioBuff::Alloc(), XrdXrootdAioPgrw::Alloc(), and XrdXrootdAioPgrw::Recycle().

+ Here is the caller graph for this function:

◆ aioUpdReq()

void XrdXrootdProtocol::aioUpdReq ( int  val)
inline

Definition at line 165 of file XrdXrootdProtocol.hh.

165 {linkAioReq += val;}

References linkAioReq.

◆ Buffer()

char * XrdXrootdProtocol::Buffer ( XrdSfsXioHandle  h,
int *  bsz 
)
static

Definition at line 895 of file XrdXrootdProtocol.cc.

896 {
897  XrdBuffer *xbP = (XrdBuffer *)h;
898 
899  if (h)
900  {if (bsz) *bsz = xbP->bsize;
901  return xbP->buff;
902  }
903  if (bsz) *bsz = 0;
904  return 0;
905 }
int bsize
Definition: XrdBuffer.hh:46
char * buff
Definition: XrdBuffer.hh:45

References XrdBuffer::bsize, and XrdBuffer::buff.

◆ Claim()

XrdSfsXioHandle XrdXrootdProtocol::Claim ( const char *  curBuff,
int  datasz,
int  minasz = 0 
)
overridevirtual

Claim ownership of the current buffer if it is memory effecient to do so.

Parameters
curBuff- The address of the current buffer. It must match the the buffer that was most recently passed to the caller.
datasz- Number of useful bytes in the buffer (i.e. write size).
minasz- Minimum buffer size that would be allocated to copy data.
Returns
!0 The buffer handle of the current buffer is returned along with ownership rights.
=0 Too much memory would be wasted by transferring ownership (errno == 0) or an error ocurred (errno != 0). When an error see Swap() below for possible types of errors.

Implements XrdSfsXio.

Definition at line 911 of file XrdXrootdProtocol.cc.

913 {
914 
915 // Qualify swap choice
916 //
917  if (minasz >= argp->bsize || datasz >= argp->bsize/2) return Swap(buff);
918  errno = 0;
919  return 0;
920 }
XrdSfsXioHandle Swap(const char *buff, XrdSfsXioHandle h=0) override

References argp, XrdBuffer::bsize, and Swap().

+ Here is the call graph for this function:

◆ CloseRequestCb()

bool XrdXrootdProtocol::CloseRequestCb ( void *  cbarg)
staticprotected

Definition at line 1541 of file XrdXrootdProtocol.cc.

1542 {
1543  XrdXrootdProtocol *pp = (XrdXrootdProtocol*)cbarg;
1544  return pp->RequestClose();
1545 }

References RequestClose().

+ Here is the call graph for this function:

◆ Configure()

int XrdXrootdProtocol::Configure ( char *  parms,
XrdProtocol_Config pi 
)
static

Definition at line 176 of file XrdXrootdConfig.cc.

177 {
178 /*
179  Function: Establish configuration at load time.
180 
181  Input: None.
182 
183  Output: 0 upon success or !0 otherwise.
184 */
185 
187  (XrdSfsFileSystem *nativeFS,
189  const char *configFn,
190  const char *theParms);
191 
192  XrdOucEnv xrootdEnv;
193  XrdXrootdXPath *xp;
194  char *adminp, *rdf, *bP, *tmp, buff[1024];
195  int i, n;
196 
197 // Copy out the special info we want to use at top level
198 //
199  eDest.logger(pi->eDest->logger());
201  SI = new XrdXrootdStats(pi->Stats);
202  XrdXrootd::SI= SI;
203  Sched = pi->Sched; XrdXrootd::Sched = pi->Sched;
204  BPool = pi->BPool; XrdXrootd::BPool = pi->BPool;
205  hailWait = pi->hailWait;
206  readWait = pi->readWait;
207  Port = pi->Port;
208  myInst = pi->myInst;
209  Window = pi->WSize;
210  tlsPort = pi->tlsPort;
211  tlsCtx = pi->tlsCtx;
212  XrdXrootdCF = pi->totalCF;
213 
214 // Record globally accessible values
215 //
217  XrdXrootdPort = pi->Port;
218 
219 // Set the callback object static areas now!
220 //
222 
223 // Pick up exported paths from the command line
224 //
225  for (i = 1; i < pi->argc; i++) xexpdo(pi->argv[i]);
226 
227 // Pre-initialize some i/o values. Note that we now set maximum readv element
228 // transfer size to the buffer size (before it was a reasonable 256K).
229 //
230  n = (pi->theEnv ? pi->theEnv->GetInt("MaxBuffSize") : 0);
231  maxTransz = maxBuffsz = (n ? n : BPool->MaxSize());
232  maxReadv_ior = maxTransz-(int)sizeof(readahead_list);
233 
234 // Export the readv_ior_max and readv_iov_max values
235 //
236  {char buff[256];
237  snprintf(buff, sizeof(buff), "%d,%d", maxReadv_ior, XrdProto::maxRvecsz);
238  XrdOucEnv::Export("XRD_READV_LIMITS", buff);
239  }
240 
241  memset(Route, 0, sizeof(Route));
242 
243 // Now process and configuration parameters
244 //
245  rdf = (parms && *parms ? parms : pi->ConfigFN);
246  if (rdf && Config(rdf)) return 0;
248 
249 // Initialize the packet marking framework if configured. We do that here as
250 // nothing else following this code can fail but we can so be consistent.
251 //
252  bool bad = false;
254  if (PMark)
255  {if (pi->theEnv) pi->theEnv->PutPtr("XrdNetPMark*", PMark);
256  xrootdEnv.PutPtr("XrdNetPMark*", PMark);
257  }
258  else if (bad) return 0;
259 
260 // Check if we are exporting a generic object name
261 //
262  if (XPList.Opts() & XROOTDXP_NOSLASH)
263  {eDest.Say("Config exporting ", XPList.Path(n)); n += 2;}
264  else n = 0;
265 
266 // Check if we are exporting anything
267 //
268  if (!(xp = XPList.Next()) && !n)
269  {XPList.Insert("/tmp"); n = 8;
270  eDest.Say("Config warning: only '/tmp' will be exported.");
271  } else {
272  while(xp) {eDest.Say("Config exporting ", xp->Path(i));
273  n += i+2; xp = xp->Next();
274  }
275  }
276 
277 // Export the exports
278 //
279  bP = tmp = (char *)malloc(n);
280  if (XPList.Opts() & XROOTDXP_NOSLASH)
281  {strcpy(bP, XPList.Path(i)); bP += i, *bP++ = ' ';}
282  xp = XPList.Next();
283  while(xp) {strcpy(bP, xp->Path(i)); bP += i; *bP++ = ' '; xp = xp->Next();}
284  *(bP-1) = '\0';
285  XrdOucEnv::Export("XRDEXPORTS", tmp); free(tmp);
286 
287 // Initialize the security system if this is wanted
288 //
289  if (!ConfigSecurity(xrootdEnv, pi->ConfigFN)) return 0;
290 
291 // Set up the network for self-identification and display it
292 //
293  pi->NetTCP->netIF.Port(Port);
294  pi->NetTCP->netIF.Display("Config ");
295 
296 // Establish our specific environment that will be passed along
297 //
298  xrootdEnv.PutPtr("XrdInet*", (void *)(pi->NetTCP));
299  xrootdEnv.PutPtr("XrdNetIF*", (void *)(&(pi->NetTCP->netIF)));
300  xrootdEnv.PutPtr("XrdScheduler*", Sched);
301 
302 // Copy over the xrd environment which contains plugin argv's and re-export
303 // the monitoring registration object into out own env for simplicity
304 //
305  if (pi->theEnv)
306  {xrootdEnv.PutPtr("xrdEnv*", pi->theEnv);
307  void* theMon = pi->theEnv->GetPtr("XrdMonRoll*");
308  if (theMon) xrootdEnv.PutPtr("XrdMonRoll*", theMon);
309  }
310 
311 // Initialize monitoring (it won't do anything if it wasn't enabled). This
312 // needs to be done before we load any plugins as plugins may need monitoring.
313 //
314  if (!ConfigMon(pi, xrootdEnv)) return 0;
315 
316 // Get the filesystem to be used and its features.
317 //
318  if (!ConfigFS(xrootdEnv, pi->ConfigFN)) return 0;
319  fsFeatures = osFS->Features();
321  if (pi->theEnv) pi->theEnv->PutPtr("XrdSfsFileSystem*", osFS);
322 
323 // Check if the file system includes a custom prepare handler as this will
324 // affect how we handle prepare requests.
325 //
326  if (fsFeatures & XrdSfs::hasPRP2 || xrootdEnv.Get("XRD_PrepHandler"))
327  PrepareAlt = true;
328 
329 // Check if the diglib should be loaded. We only support the builtin one. In
330 // the future we will have to change this code to be like the above.
331 //
332  if (digParm)
333  {TRACE(DEBUG, "Loading dig filesystem builtin");
334  digFS = XrdDigGetFS(osFS, eDest.logger(), pi->ConfigFN, digParm);
335  if (!digFS) eDest.Emsg("Config","Unable to load digFS; "
336  "remote debugging disabled!");
337  }
338 
339 // Check if we are going to be processing checksums locally
340 //
341  if (JobCKT) {
342  XrdOucString csList(1024);
343  XrdOucErrInfo myError("Config");
344  XrdOucTList *tP = JobCKTLST;
345  int csNum = 0;
346  do {
347  if(JobLCL) {
348  // Check natively supported checksum
349  if (osFS->chksum(XrdSfsFileSystem::csSize, tP->text, 0, myError)) {
350  eDest.Emsg("Config", tP->text, "checksum is not natively supported.");
351  return 0;
352  }
353  }
354  tP->ival[1] = myError.getErrInfo();
355  if (csNum) csList += ',';
356  csList.append(csNum);
357  csList.append(':');
358  csList.append(tP->text);
359  csNum++;
360  tP = tP->next;
361  } while (tP);
362  if (csNum) XrdOucEnv::Export("XRD_CSLIST", csList.c_str());
363  }
364 
365 // Configure the redirect plugins. After loading the chain we publish the
366 // final pointer in two places: the protocol environment (so external
367 // plugins can fetch the raw pointer of the plugin via the
368 // "XrdXrootdRedirPI*" key) and XrdXrootdRedirHelper, the in-tree adapter
369 // that fsRedirPI() and the HTTP TPC handler both call to apply plugin-
370 // driven routing (issue #2767).
371 //
372  if (!RDLPath.empty())
373  {for (int i = 0; i < (int)RDLPath.size(); i++)
374  {const char* parm = (RDLParm[i].length() ? RDLParm[i].c_str() : 0);
375  if (!ConfigRedirPI(RDLPath[i].c_str(),xrootdEnv,pi->ConfigFN,parm))
376  return 0;
377  if (pi->theEnv)
378  pi->theEnv->PutPtr("XrdXrootdRedirPI*", RedirPI);
379  }
381  }
382 
383 // Initialiaze for AIO. If we are not in debug mode and aio is enabled then we
384 // turn off async I/O if tghe filesystem requests it or if this is a caching
385 // proxy and we were asked not to use aio in such a cacse.
386 //
387  if (!(asyncFlags & asDebug) && as_aioOK)
388  {if (fsFeatures & XrdSfs::hasNAIO) as_aioOK = false;
389  else if (asyncFlags & asNoCache && fsFeatures & XrdSfs::hasCACH)
390  as_aioOK = false;
391  if (!as_aioOK) eDest.Say("Config asynchronous I/O has been disabled!");
392  }
393 
394 // Compute the maximum stutter allowed during async I/O (one per 64k)
395 //
396  if (as_segsize > 65536) as_okstutter = as_segsize/65536;
397 
398 // Establish final sendfile processing mode. This may be turned off by the
399 // link or by the SFS plugin usually because it's a proxy.
400 //
401  const char *why = 0;
402  if (!as_nosf)
403  {if (fsFeatures & XrdSfs::hasNOSF) why = "file system plugin.";
404  else if (!XrdLink::sfOK) why = "OS kernel.";
405  if (why)
406  {as_nosf = true;
407  eDest.Say("Config sendfile has been disabled by ", why);
408  }
409  }
410 
411 // Create the file lock manager and initialize file handling
412 //
415 
416 // Schedule protocol object cleanup (also advise the transit protocol)
417 //
418  ProtStack.Set(pi->Sched, &XrdXrootdTrace, TRACE_MEM);
419  n = (pi->ConnMax/3 ? pi->ConnMax/3 : 30);
420  ProtStack.Set(n, 60*60);
421  XrdXrootdTransit::Init(pi->Sched, n, 60*60);
422 
423 // Initialize the request ID generation object
424 //
425  PrepID = new XrdOucReqID(pi->urAddr, (int)Port);
426 
427 // Initialize for prepare processing
428 //
430  sprintf(buff, "%%s://%s:%d/&L=%%d&U=%%s", pi->myName, pi->Port);
431  Notify = strdup(buff);
432 
433 // Set the redirect flag if we are a pure redirector
434 //
435  int tlsFlags = myRole & kXR_tlsAny;
437  if ((rdf = getenv("XRDREDIRECT"))
438  && (!strcmp(rdf, "R") || !strcmp(rdf, "M")))
439  {isRedir = *rdf;
441  if (!strcmp(rdf, "M")) myRole |=kXR_attrMeta;
442  }
445  myRole |= tlsFlags;
446 
447 // Turn off client redirects if we are neither a redirector nor a proxy server
448 //
449  if (CL_Redir && !isRedir && !isProxy)
450  {CL_Redir = false;
451  eDest.Say("Config warning: 'redirect client' ignored; "
452  "not a redirector nor a proxy server");
453  }
454 
455 // Check if we are redirecting anything
456 //
457  if ((xp = RPList.Next()))
458  {int k;
459  char buff[2048], puff[1024];
460  do {k = xp->Opts();
461  if (Route[k].Host[0] == Route[k].Host[1]
462  && Route[k].Port[0] == Route[k].Port[1]) *puff = 0;
463  else sprintf(puff, "%%%s:%d", Route[k].Host[1], Route[k].Port[1]);
464  sprintf(buff," to %s:%d%s",Route[k].Host[0],Route[k].Port[0],puff);
465  eDest.Say("Config redirect static ", xp->Path(), buff);
466  xp = xp->Next();
467  } while(xp);
468  }
469 
470  if ((xp = RQList.Next()))
471  {int k;
472  const char *cgi1, *cgi2;
473  char buff[2048], puff[1024], xCgi[RD_Num] = {0};
474  if (isRedir) {cgi1 = "+"; cgi2 = getenv("XRDCMSCLUSTERID");}
475  else {cgi1 = ""; cgi2 = pi->myName;}
476  myCNlen = snprintf(buff, sizeof(buff), "%s%s", cgi1, cgi2);
477  myCName = strdup(buff);
478  do {k = xp->Opts();
479  if (Route[k].Host[0] == Route[k].Host[1]
480  && Route[k].Port[0] == Route[k].Port[1]) *puff = 0;
481  else sprintf(puff, "%%%s:%d", Route[k].Host[1], Route[k].Port[1]);
482  sprintf(buff," to %s:%d%s",Route[k].Host[0],Route[k].Port[0],puff);
483  eDest.Say("Config redirect enoent ", xp->Path(), buff);
484  if (!xCgi[k] && cgi2)
485  {bool isdup = Route[k].Host[0] == Route[k].Host[1]
486  && Route[k].Port[0] == Route[k].Port[1];
487  for (i = 0; i < 2; i++)
488  {n = snprintf(buff,sizeof(buff), "%s?tried=%s%s",
489  Route[k].Host[i], cgi1, cgi2);
490  free(Route[k].Host[i]); Route[k].Host[i] = strdup(buff);
491  Route[k].RDSz[i] = n;
492  if (isdup) {Route[k].Host[1] = Route[k].Host[0];
493  Route[k].RDSz[1] = n; break;
494  }
495  }
496  }
497  xCgi[k] = 1;
498  xp = xp->Next();
499  } while(xp);
500  }
501 
502 // Add all jobs that we can run to the admin object
503 //
504  if (JobCKS) XrdXrootdAdmin::addJob("chksum", JobCKS);
505 
506 // Establish the path to be used for admin functions. We will loose this
507 // storage upon an error but we don't care because we'll just exit.
508 //
509  adminp = XrdOucUtils::genPath(pi->AdmPath, 0, ".xrootd");
510 
511 // Setup the admin path (used in all roles).
512 //
513  if (!(AdminSock = XrdNetSocket::Create(&eDest, adminp, "admin", pi->AdmMode))
514  || !XrdXrootdAdmin::Init(&eDest, AdminSock)) return 0;
515 
516 // Indicate whether or not we support extended attributes
517 //
518  {XrdOucEnv myEnv;
519  XrdOucErrInfo eInfo("", &myEnv);
520  char buff[128];
521  if (osFS->FAttr(0, eInfo, 0) == SFS_OK)
522  {usxMaxNsz = myEnv.GetInt("usxMaxNsz");
523  if (usxMaxNsz < 0) usxMaxNsz = 0;
524  usxMaxVsz = myEnv.GetInt("usxMaxVsz");
525  if (usxMaxVsz < 0) usxMaxVsz = 0;
526  snprintf(buff, sizeof(buff), "%d %d", usxMaxNsz, usxMaxVsz);
527  usxParms = strdup(buff);
528  } else {
529  usxMaxNsz = 0;
530  usxMaxVsz = 0;
531  usxParms = strdup("0 0");
532  }
533  }
534 
535 // Finally, check if we really need to be in bypass mode if it is set
536 //
537  if (OD_Bypass)
538  {const char *penv = getenv("XRDXROOTD_PROXY");
539  if (!penv || *penv != '=')
540  {OD_Bypass = false;
541  eDest.Say("Config warning: 'fsoverload bypass' ignored; "
542  "not a forwarding proxy.");
543  }
544  }
545 
546 // Add any additional features
547 //
552  myRole |= kXR_anongpf;
553 
554 // Finally note whether or not we have TLS enabled
555 //
556  if (tlsCtx) myRole |= kXR_haveTLS;
557 
558 // Return success
559 //
560  free(adminp);
561  return 1;
562 }
#define kXR_isManager
Definition: XProtocol.hh:1198
#define kXR_suppgrw
Definition: XProtocol.hh:1216
#define kXR_attrMeta
Definition: XProtocol.hh:1201
#define kXR_haveTLS
Definition: XProtocol.hh:1221
#define kXR_anongpf
Definition: XProtocol.hh:1214
#define kXR_tlsAny
Definition: XProtocol.hh:1223
#define kXR_isServer
Definition: XProtocol.hh:1199
#define kXR_attrCache
Definition: XProtocol.hh:1200
#define kXR_attrProxy
Definition: XProtocol.hh:1202
#define kXR_LBalServer
Definition: XProtocol.hh:1193
#define kXR_supposc
Definition: XProtocol.hh:1217
#define kXR_DataServer
Definition: XProtocol.hh:1192
#define kXR_supgpf
Definition: XProtocol.hh:1215
#define DEBUG(x)
Definition: XrdBwmTrace.hh:54
XrdSfsFileSystem * XrdDigGetFS(XrdSfsFileSystem *native_fs, XrdSysLogger *lp, const char *cFN, const char *parms)
Definition: XrdDigFS.cc:105
#define SFS_OK
#define TRACE_MEM
Definition: XrdTrace.hh:38
#define TRACE(act, x)
Definition: XrdTrace.hh:63
#define TRACE_ALL
Definition: XrdTrace.hh:35
const char * XrdXrootdInstance
XrdSysTrace XrdXrootdTrace
XrdXrootdPrepare * XrdXrootdPrepQ
XrdOucString * XrdXrootdCF
int XrdXrootdPort
#define XROOTDXP_NOSLASH
static XrdNetIF netIF
Definition: XrdInet.hh:68
void Display(const char *pfx="=====> ")
Definition: XrdNetIF.cc:142
int Port()
Definition: XrdNetIF.hh:322
static XrdNetPMark * Config(XrdSysError *eLog, XrdScheduler *sched, XrdSysTrace *trc, bool &fatal)
static XrdNetSocket * Create(XrdSysError *Say, const char *path, const char *fn, mode_t mode, int isudp=0)
void Set(int inQMax, time_t agemax=1800)
Definition: XrdObject.icc:90
long GetInt(const char *varname)
Definition: XrdOucEnv.cc:253
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:188
void * GetPtr(const char *varname)
Definition: XrdOucEnv.cc:281
char * Get(const char *varname)
Definition: XrdOucEnv.hh:69
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:316
XrdOucTList * next
Definition: XrdOucTList.hh:45
char * text
Definition: XrdOucTList.hh:46
static char * genPath(const char *path, const char *inst, const char *psfx=0)
Definition: XrdOucUtils.cc:506
const char * myName
Definition: XrdProtocol.hh:82
XrdBuffManager * BPool
Definition: XrdProtocol.hh:63
XrdScheduler * Sched
Definition: XrdProtocol.hh:64
XrdTlsContext * tlsCtx
Definition: XrdProtocol.hh:99
const char * AdmPath
Definition: XrdProtocol.hh:76
XrdSysError * eDest
Definition: XrdProtocol.hh:61
XrdOucString * totalCF
Definition: XrdProtocol.hh:100
XrdOucEnv * theEnv
Definition: XrdProtocol.hh:66
const char * myInst
Definition: XrdProtocol.hh:81
XrdStats * Stats
Definition: XrdProtocol.hh:65
virtual int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
virtual int FAttr(XrdSfsFACtl *faReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:116
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
Definition: XrdSysError.cc:162
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:175
void SetLogger(XrdSysLogger *logp)
Definition: XrdSysTrace.cc:65
static int Init(XrdSysError *erp, XrdNetSocket *asock)
static void addJob(const char *jname, XrdXrootdJob *jp)
static void setVals(XrdSysError *erp, XrdXrootdStats *SIp, XrdScheduler *schp, int port)
static void Init(XrdXrootdFileLock *lp, XrdSysError *erP, bool sfok)
static XrdXrootdStats * SI
static const char * myInst
static XrdSfsFileSystem * digFS
static XrdNetPMark * PMark
static short as_okstutter
static XrdXrootdXPath RPList
static XrdNetSocket * AdminSock
static XrdXrootdJob * JobCKS
static XrdSysError & eDest
static char * usxParms
static XrdXrootdRedirPI * RedirPI
static const char * myCName
static XrdXrootdFileLock * Locker
static XrdTlsContext * tlsCtx
static XrdXrootdXPath XPList
static XrdScheduler * Sched
static XrdOucTList * JobCKTLST
static XrdXrootdXPath RQList
static XrdBuffManager * BPool
static uint64_t fsFeatures
static XrdOucReqID * PrepID
static struct XrdXrootdProtocol::RD_Table Route[RD_Num]
static XrdSfsFileSystem * osFS
static void Init(XrdXrootdRedirPI *pi, XrdSysError *eDest, int ipHold)
static void Init(XrdScheduler *schedP, int qMax, int qTTL)
Perform one-time initialization.
void Insert(const char *pd, int popt=0, int flags=XROOTDXP_OK)
XrdXrootdXPath * Next()
XrdSysLogger Logger
Definition: XrdGlobals.cc:47
static const int maxRvecsz
Definition: XProtocol.hh:722
static const uint64_t hasPGRW
Feature: pgRead and pgWrite.
Definition: XrdSfsFlags.hh:56
static const uint64_t hasPRP2
Feature: Prepare Handler Version 2 (different calling conventions)
Definition: XrdSfsFlags.hh:62
static const uint64_t hasGPFA
Feature: gpFile anonymous.
Definition: XrdSfsFlags.hh:53
static const uint64_t hasCACH
Feature: Implements a data cache.
Definition: XrdSfsFlags.hh:74
static const uint64_t hasNOSF
Feature: Supports no sendfile.
Definition: XrdSfsFlags.hh:71
static const uint64_t hasPOSC
Feature: Persist On Successful Close.
Definition: XrdSfsFlags.hh:59
static const uint64_t hasGPF
Feature: gpFile.
Definition: XrdSfsFlags.hh:50
static const uint64_t hasNAIO
Feature: Supports no async I/O.
Definition: XrdSfsFlags.hh:77
static const uint64_t hasPRXY
Feature: Proxy Server.
Definition: XrdSfsFlags.hh:65
XrdXrootdStats * SI
XrdScheduler * Sched
XrdBuffManager * BPool

References XrdXrootdAdmin::addJob(), AdminSock, XrdProtocol_Config::AdmMode, XrdProtocol_Config::AdmPath, XrdOucString::append(), XrdProtocol_Config::argc, XrdProtocol_Config::argv, as_aioOK, as_nosf, as_okstutter, as_segsize, XrdProtocol_Config::BPool, XrdXrootd::BPool, BPool, XrdOucString::c_str(), XrdSfsFileSystem::chksum(), CL_Redir, XrdNetPMarkCfg::Config(), XrdProtocol_Config::ConfigFN, XrdProtocol_Config::ConnMax, XrdNetSocket::Create(), XrdSfsFileSystem::csSize, DEBUG, XrdProtocol_Config::DebugON, digFS, XrdNetIF::Display(), XrdProtocol_Config::eDest, eDest, XrdSysError::Emsg(), XrdOucEnv::Export(), XrdSfsFileSystem::FAttr(), XrdSfsFileSystem::Features(), fsFeatures, XrdOucUtils::genPath(), XrdOucEnv::Get(), XrdOucErrInfo::getErrInfo(), XrdOucEnv::GetInt(), XrdOucEnv::GetPtr(), XrdProtocol_Config::hailWait, hailWait, XrdSfs::hasCACH, XrdSfs::hasGPF, XrdSfs::hasGPFA, XrdSfs::hasNAIO, XrdSfs::hasNOSF, XrdSfs::hasPGRW, XrdSfs::hasPOSC, XrdSfs::hasPRP2, XrdSfs::hasPRXY, XrdXrootdProtocol::RD_Table::Host, XrdXrootdTransit::Init(), XrdXrootdAdmin::Init(), XrdXrootdFile::Init(), XrdXrootdRedirHelper::Init(), XrdXrootdXPath::Insert(), isProxy, isRedir, JobCKS, JobCKT, JobCKTLST, JobLCL, kXR_anongpf, kXR_attrCache, kXR_attrMeta, kXR_attrProxy, kXR_DataServer, kXR_haveTLS, kXR_isManager, kXR_isServer, kXR_LBalServer, kXR_supgpf, kXR_suppgrw, kXR_supposc, kXR_tlsAny, Locker, XrdGlobal::Logger, XrdSysError::logger(), maxBuffsz, maxReadv_ior, XrdProto::maxRvecsz, XrdBuffManager::MaxSize(), maxTransz, myCName, myCNlen, XrdProtocol_Config::myInst, myInst, XrdProtocol_Config::myName, myRole, myRolf, XrdInet::netIF, XrdProtocol_Config::NetTCP, XrdOucTList::next, XrdXrootdXPath::Next(), Notify, OD_Bypass, XrdXrootdXPath::Opts(), osFS, XrdXrootdXPath::Path(), PMark, XrdProtocol_Config::Port, XrdNetIF::Port(), Port, XrdXrootdProtocol::RD_Table::Port, PrepareAlt, PrepID, XrdOucEnv::PutPtr(), XrdXrootdProtocol::RD_Table::RDSz, XrdProtocol_Config::readWait, readWait, redirIPHold, RedirPI, Route, RPList, RQList, XrdSysError::Say(), XrdProtocol_Config::Sched, XrdXrootd::Sched, Sched, XrdObjectQ< T >::Set(), XrdSysTrace::SetLogger(), XrdXrootdCallBack::setVals(), XrdLink::sfOK, SFS_OK, XrdXrootd::SI, SI, XrdProtocol_Config::Stats, XrdOucTList::text, XrdProtocol_Config::theEnv, XrdProtocol_Config::tlsCtx, tlsCtx, XrdProtocol_Config::tlsPort, tlsPort, XrdProtocol_Config::totalCF, TRACE, TRACE_ALL, TRACE_MEM, usxMaxNsz, usxMaxVsz, usxParms, XrdSysTrace::What, Window, XrdProtocol_Config::WSize, XPList, XrdDigGetFS(), XrdXrootdCF, XrdXrootdInstance, XrdXrootdPort, XrdXrootdPrepQ, XrdXrootdTrace, and XROOTDXP_NOSLASH.

Referenced by XrdgetProtocol().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_WriteSpan()

int XrdXrootdProtocol::do_WriteSpan ( )

Definition at line 3555 of file XrdXrootdXeq.cc.

3556 {
3557  int rc;
3559  numWrites++;
3560 
3561 // Unmarshall the data
3562 //
3564  n2hll(Request.write.offset, IO.Offset);
3565 
3566 // Find the file object. We will only drain socket data on the control path.
3567 // .
3568  if (!FTab || !(IO.File = FTab->Get(fh.handle)))
3569  {IO.IOLen -= myBlast;
3570  IO.File = 0;
3571  return do_WriteNone(Request.write.pathid);
3572  }
3573 
3574 // If we are monitoring, insert a write entry
3575 //
3576  if (Monitor.InOut())
3578  Request.write.offset);
3579  IO.File->Stats.wrOps(IO.IOLen); // Optimistically correct
3580 
3581 // Trace this entry
3582 //
3583  TRACEP(FSIO, "fh=" <<fh.handle <<" write " <<IO.IOLen <<'@' <<IO.Offset);
3584 
3585 // Write data that was already read
3586 //
3587  if ((rc = IO.File->XrdSfsp->write(IO.Offset, myBuff, myBlast)) < 0)
3588  {IO.IOLen = IO.IOLen-myBlast; IO.EInfo[0] = rc; IO.EInfo[1] = 0;
3589  return do_WriteNone();
3590  }
3591  IO.Offset += myBlast; IO.IOLen -= myBlast;
3592 
3593 // See if we need to finish this request in the normal way
3594 //
3595  if (IO.IOLen > 0) return do_WriteAll();
3596  return Response.Send();
3597 }
kXR_char fhandle[4]
Definition: XProtocol.hh:848
struct ClientRequestHdr header
Definition: XProtocol.hh:887
kXR_int64 offset
Definition: XProtocol.hh:849
struct ClientWriteRequest write
Definition: XProtocol.hh:918
kXR_int32 dlen
Definition: XProtocol.hh:161
#define TRACEP(act, x)
virtual XrdSfsXferSize write(XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0
XrdXrootdFile * Get(int fnum)
XrdSfsFile * XrdSfsp
XrdXrootdFileStats Stats
XrdXrootdMonitor * Agent
void Add_wr(kXR_unt32 dictid, kXR_int32 wlen, kXR_int64 offset)
XrdXrootd::IOParms IO
XrdXrootdFileTable * FTab
XrdXrootdMonitor::User Monitor
XrdXrootdResponse Response
XrdXrootdFile * File

References XrdXrootdMonitor::Add_wr(), XrdXrootdMonitor::User::Agent, ClientRequestHdr::dlen, ClientWriteRequest::dlen, ClientWriteRequest::fhandle, XrdXrootd::IOParms::File, XrdXrootdFileStats::FileID, FTab, XrdXrootdFileTable::Get(), XrdXrootdFHandle::handle, ClientRequest::header, XrdXrootdMonitor::User::InOut(), IO, XrdXrootd::IOParms::IOLen, Monitor, myBlast, myBuff, numWrites, ClientWriteRequest::offset, ClientWriteRequest::pathid, Request, Response, XrdXrootdResponse::Send(), XrdXrootdFile::Stats, TRACEP, ClientRequest::write, XrdSfsFile::write(), XrdXrootdFileStats::wrOps(), and XrdXrootdFile::XrdSfsp.

+ Here is the call graph for this function:

◆ DoIt()

void XrdXrootdProtocol::DoIt ( )
inlineoverridevirtual

Implements XrdJob.

Definition at line 173 of file XrdXrootdProtocol.hh.

173 {(*this.*Resume)();}
int(XrdXrootdProtocol::* Resume)()

References Resume.

◆ getData() [1/2]

int XrdXrootdProtocol::getData ( gdCallBack gdcbP,
const char *  dtype,
char *  buff,
int  blen 
)

Referenced by Process(), and ProcSig().

+ Here is the caller graph for this function:

◆ getData() [2/2]

int XrdXrootdProtocol::getData ( gdCallBack gdcbP,
const char *  dtype,
struct iovec *  iov,
int  iovn 
)

◆ getDump()

int XrdXrootdProtocol::getDump ( const char *  dtype,
int  dlen 
)

Definition at line 1404 of file XrdXrootdProtocol.cc.

1405 {
1406  bool inCB = (gdCtl.Status == GetDataCtl::inCallBk);
1407 
1408 // Setup the control information to direct the vector read
1409 //
1410  memset((char *)&gdCtl, 0, sizeof(gdCtl));
1411  gdCtl.DumpLen = dlen; // Bytes left to drain
1412  gdCtl.ioDType = dtype; // Name of the data being read for tracing
1414 
1415 // Effect the read. We prevent recursive calls if this was called while
1416 // we were in a callback, which is possible due to I/O continuations.
1417 //
1418  return (inCB ? 1 : getDumpCont());
1419 }
struct XrdXrootdProtocol::GetDataCtl gdCtl

References gdCtl, XrdXrootdProtocol::GetDataCtl::inCallBk, XrdXrootdProtocol::GetDataCtl::inDump, XrdXrootdProtocol::GetDataCtl::ioDType, and XrdXrootdProtocol::GetDataCtl::Status.

Referenced by XrdXrootdAioTask::gdDone().

+ Here is the caller graph for this function:

◆ getPathID()

int XrdXrootdProtocol::getPathID ( )
inline

Definition at line 185 of file XrdXrootdProtocol.hh.

185 {return PathID;}

References PathID.

Referenced by XrdXrootdAioFob::Reset(), and XrdXrootdAioFob::Schedule().

+ Here is the caller graph for this function:

◆ getSID()

unsigned int XrdXrootdProtocol::getSID ( )
staticprotected

Definition at line 271 of file XrdXrootdProtocol.cc.

272 {
273  static XrdSysMutex SidMutex;
274  static unsigned int Sid = 1;
275  unsigned int theSid;
276 
277 // Generate unqiue number for this server instance
278 //
279  AtomicBeg(SidMutex);
280  theSid = AtomicInc(Sid);
281  AtomicEnd(SidMutex);
282  return theSid;
283 }
#define AtomicInc(x)
#define AtomicBeg(Mtx)
#define AtomicEnd(Mtx)

References AtomicBeg, AtomicEnd, and AtomicInc.

◆ Match()

XrdProtocol * XrdXrootdProtocol::Match ( XrdLink lp)
overridevirtual

Implements XrdProtocol.

Definition at line 291 of file XrdXrootdProtocol.cc.

292 {
293 static const int hsSZ = sizeof(ClientInitHandShake);
294  char hsbuff[hsSZ];
295  struct ClientInitHandShake *hsData = (ClientInitHandShake *)hsbuff;
296 
297 static struct hs_response
298  {kXR_unt16 streamid;
299  kXR_unt16 status;
300  kXR_unt32 rlen; // Specified as kXR_int32 in doc!
301  kXR_unt32 pval; // Specified as kXR_int32 in doc!
302  kXR_unt32 styp; // Specified as kXR_int32 in doc!
303  } hsresp={0, 0, htonl(8), htonl(kXR_PROTOCOLVERSION),
304  (isRedir ? htonl((unsigned int)kXR_LBalServer)
305  : htonl((unsigned int)kXR_DataServer))};
307 int dlen, rc;
308 
309 // Peek at the first 20 bytes of data
310 //
311  if ((dlen = lp->Peek(hsbuff, hsSZ, hailWait)) < hsSZ)
312  {if (dlen <= 0) lp->setEtext("handshake not received");
313  return (XrdProtocol *)0;
314  }
315 
316 // Trace the data
317 //
318 // TRACEI(REQ, "received: " <<Trace->bin2hex(hsbuff,dlen));
319 
320 // Verify that this is our protocol
321 //
322  hsData->fourth = ntohl(hsData->fourth);
323  hsData->fifth = ntohl(hsData->fifth);
324  if (hsData->first || hsData->second || hsData->third
325  || hsData->fourth != 4 || hsData->fifth != ROOTD_PQ) return 0;
326 
327 // Send the handshake response. We used optimize the subsequent protocol
328 // request sent with handshake but the protocol request is now overloaded.
329 //
330  rc = lp->Send((char *)&hsresp, sizeof(hsresp));
331 
332 // Verify that our handshake response was actually sent
333 //
334  if (!rc)
335  {lp->setEtext("handshake failed");
336  return (XrdProtocol *)0;
337  }
338 
339 // We can now read all 20 bytes and discard them (no need to wait for it)
340 //
341  if (lp->Recv(hsbuff, hsSZ) != hsSZ)
342  {lp->setEtext("reread failed");
343  return (XrdProtocol *)0;
344  }
345 
346 // Get a protocol object off the stack (if none, allocate a new one)
347 //
348  if (!(xp = ProtStack.Pop())) xp = new XrdXrootdProtocol();
349 
350 // Bind the protocol to the link and return the protocol
351 //
352  SI->Bump(SI->Count);
353  xp->Link = lp;
354  xp->Response.Set(lp);
355  strcpy(xp->Entity.prot, "host");
356  xp->Entity.host = (char *)lp->Host();
357  xp->Entity.addrInfo = lp->AddrInfo();
358  return (XrdProtocol *)xp;
359 }
kXR_int32 fourth
Definition: XProtocol.hh:88
#define kXR_PROTOCOLVERSION
Definition: XProtocol.hh:70
kXR_int32 second
Definition: XProtocol.hh:86
unsigned int kXR_unt32
Definition: XPtypes.hh:90
unsigned short kXR_unt16
Definition: XPtypes.hh:67
#define ROOTD_PQ
T * Pop()
Definition: XrdObject.hh:93
void Bump(int &val)
Definition: XrdOucStats.hh:47
XrdNetAddrInfo * addrInfo
Entity's connection details.
Definition: XrdSecEntity.hh:80
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
Definition: XrdSecEntity.hh:67
char * host
Entity's host name dnr dependent.
Definition: XrdSecEntity.hh:70
void Set(XrdLink *lp)

References XrdXrootdProtocol(), XrdLink::AddrInfo(), XrdSecEntity::addrInfo, XrdOucStats::Bump(), XrdXrootdStats::Count, Entity, ClientInitHandShake::fifth, ClientInitHandShake::first, ClientInitHandShake::fourth, hailWait, XrdLink::Host(), XrdSecEntity::host, isRedir, kXR_DataServer, kXR_LBalServer, kXR_PROTOCOLVERSION, Link, XrdLink::Peek(), XrdObjectQ< T >::Pop(), XrdSecEntity::prot, XrdLink::Recv(), Response, ROOTD_PQ, ClientInitHandShake::second, XrdLink::Send(), XrdXrootdResponse::Set(), XrdLink::setEtext(), SI, and ClientInitHandShake::third.

+ Here is the call graph for this function:

◆ MonAuth()

void XrdXrootdProtocol::MonAuth ( )
protected

Definition at line 4345 of file XrdXrootdXeq.cc.

4346 {
4347  char Buff[4096];
4348  const char *bP = Buff;
4349 
4350  if (Client == &Entity) bP = Entity.moninfo;
4351  else {snprintf(Buff,sizeof(Buff),
4352  "&p=%s&n=%s&h=%s&o=%s&r=%s&g=%s&m=%s%s&I=%c",
4353  Client->prot,
4354  (Client->name ? Client->name : ""),
4355  (Client->host ? Client->host : ""),
4356  (Client->vorg ? Client->vorg : ""),
4357  (Client->role ? Client->role : ""),
4358  (Client->grps ? Client->grps : ""),
4359  (Client->moninfo ? Client->moninfo : ""),
4360  (Entity.moninfo ? Entity.moninfo : ""),
4361  (clientPV & XrdOucEI::uIPv4 ? '4' : '6')
4362  );
4363  Client->secMon = &Monitor;
4364  }
4365 
4366  Monitor.Report(bP);
4367  if (Entity.moninfo) {free(Entity.moninfo); Entity.moninfo = 0;}
4368 }
char * vorg
Entity's virtual organization(s)
Definition: XrdSecEntity.hh:71
XrdSecMonitor * secMon
If !0 security monitoring enabled.
Definition: XrdSecEntity.hh:89
char * grps
Entity's group name(s)
Definition: XrdSecEntity.hh:73
char * name
Entity's name.
Definition: XrdSecEntity.hh:69
char * role
Entity's role(s)
Definition: XrdSecEntity.hh:72
char * moninfo
Information for monitoring.
Definition: XrdSecEntity.hh:76
void Report(const char *Info)
XrdSecEntity * Client
static const int uIPv4
ucap: Supports read redirects

References Client, clientPV, Entity, XrdSecEntity::grps, XrdSecEntity::host, XrdSecEntity::moninfo, Monitor, XrdSecEntity::name, XrdSecEntity::prot, XrdXrootdMonitor::User::Report(), XrdSecEntity::role, XrdSecEntity::secMon, XrdOucEI::uIPv4, and XrdSecEntity::vorg.

+ Here is the call graph for this function:

◆ operator=()

XrdXrootdProtocol XrdXrootdProtocol::operator= ( const XrdXrootdProtocol rhs)
delete

◆ Process()

int XrdXrootdProtocol::Process ( XrdLink lp)
overridevirtual

Implements XrdProtocol.

Reimplemented in XrdXrootdTransit.

Definition at line 368 of file XrdXrootdProtocol.cc.

369 {
370  int rc;
371  kXR_unt16 reqID;
372 
373 // Check if we are servicing a slow link
374 //
375  if (Resume)
376  {if (myBlen && (rc = getData("data", myBuff, myBlen)) != 0) return rc;
377  else if ((rc = (*this.*Resume)()) != 0) return rc;
378  else {Resume = 0; return 0;}
379  }
380 
381 // Read the next request header
382 //
383  if ((rc=getData("request",(char *)&Request,sizeof(Request))) != 0) return rc;
384 
385 // Check if we need to copy the request prior to unmarshalling it
386 //
387  reqID = ntohs(Request.header.requestid);
388  if (reqID != kXR_sigver && NEED2SECURE(Protect)(Request))
389  {memcpy(&sigReq2Ver, &Request, sizeof(ClientRequest));
390  sigNeed = true;
391  }
392 
393 // Deserialize the data
394 //
395  Request.header.requestid = reqID;
398  TRACEP(REQ, "req=" <<XProtocol::reqName(reqID)
399  <<" dlen=" <<Request.header.dlen);
400 
401 // Every request has an associated data length. It better be >= 0 or we won't
402 // be able to know how much data to read.
403 //
404  if (Request.header.dlen < 0)
405  {Response.Send(kXR_ArgInvalid, "Invalid request data length");
406  return Link->setEtext("protocol data length error");
407  }
408 
409 // Process sigver requests now as they appear ahead of a request
410 //
411  if (reqID == kXR_sigver) return ProcSig();
412 
413 // Read any argument data at this point, except when the request is a write.
414 // The argument may have to be segmented and we're not prepared to do that here.
415 //
416  if (reqID != kXR_write && reqID != kXR_pgwrite && Request.header.dlen)
417  {if (!argp || Request.header.dlen+1 > argp->bsize)
418  {if (argp) BPool->Release(argp);
419  if (!(argp = BPool->Obtain(Request.header.dlen+1)))
420  {Response.Send(kXR_ArgTooLong, "Request argument is too long");
421  return 0;
422  }
423  hcNow = hcPrev; halfBSize = argp->bsize >> 1;
424  }
425  argp->buff[Request.header.dlen] = '\0';
426  if ((rc = getData("arg", argp->buff, Request.header.dlen)))
427  {Resume = &XrdXrootdProtocol::Process2; return rc;}
428  }
429 
430 // Continue with request processing at the resume point
431 //
432  return Process2();
433 }
@ kXR_ArgInvalid
Definition: XProtocol.hh:1032
@ kXR_ArgTooLong
Definition: XProtocol.hh:1034
kXR_char streamid[2]
Definition: XProtocol.hh:158
kXR_unt16 requestid
Definition: XProtocol.hh:159
@ kXR_sigver
Definition: XProtocol.hh:142
@ kXR_write
Definition: XProtocol.hh:132
@ kXR_pgwrite
Definition: XProtocol.hh:139
#define NEED2SECURE(protP)
This class implements the XRootD protocol security protection.
static const char * reqName(kXR_unt16 reqCode)
Definition: XProtocol.cc:153
void Release(XrdBuffer *bp)
Definition: XrdBuffer.cc:221
XrdBuffer * Obtain(int bsz)
Definition: XrdBuffer.cc:140
XrdSecProtect * Protect
ClientRequest sigReq2Ver
int getData(gdCallBack *gdcbP, const char *dtype, char *buff, int blen)

References argp, BPool, XrdBuffer::bsize, XrdBuffer::buff, ClientRequestHdr::dlen, getData(), halfBSize, hcNow, hcPrev, ClientRequest::header, kXR_ArgInvalid, kXR_ArgTooLong, kXR_pgwrite, kXR_sigver, kXR_write, Link, myBlen, myBuff, NEED2SECURE, XrdBuffManager::Obtain(), Process2(), ProcSig(), Protect, XrdBuffManager::Release(), XProtocol::reqName(), Request, ClientRequestHdr::requestid, Response, Resume, XrdXrootdResponse::Send(), XrdXrootdResponse::Set(), XrdLink::setEtext(), sigNeed, sigReq2Ver, ClientRequestHdr::streamid, and TRACEP.

Referenced by XrdXrootdTransit::Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Process2()

int XrdXrootdProtocol::Process2 ( )

Definition at line 439 of file XrdXrootdProtocol.cc.

440 {
441 // If we are verifying requests, see if this request needs to be verified
442 //
443  if (sigNeed)
444  {const char *eText = "Request not signed";
445  if (!sigHere || (eText = Protect->Verify(sigReq,sigReq2Ver,argp->buff)))
446  {Response.Send(kXR_SigVerErr, eText);
448  <<" verification failed; " <<eText);
449  SI->Bump(SI->badSCnt);
450  return Link->setEtext(eText);
451  } else {
452  SI->Bump(SI->aokSCnt);
453  sigNeed = sigHere = false;
454  }
455  } else {
456  if (sigHere)
458  <<" unneeded signature discarded.");
459  if (sigWarn)
460  {eDest.Emsg("Protocol","Client is needlessly signing requests.");
461  sigWarn = false;
462  }
463  SI->Bump(SI->ignSCnt);
464  sigHere = false;
465  }
466  }
467 
468 // If the user is not yet logged in, restrict what the user can do
469 //
470  if (!Status)
471  switch(Request.header.requestid)
472  {case kXR_login: return do_Login();
473  case kXR_protocol: return do_Protocol();
474  case kXR_bind: return do_Bind();
476  "Invalid request; user not logged in");
477  return Link->setEtext("request without login");
478  }
479 
480 // Help the compiler, select the the high activity requests (the ones with
481 // file handles) in a separate switch statement. A special case exists for
482 // sync() which return with a callback, so handle it here. Note that stat(fh)
483 // normally never does a callback but historically we allowed it to do so.
484 // We maintain that capability even when it's likely never used.
485 //
486  switch(Request.header.requestid) // First, the ones with file handles
487  {case kXR_read: return do_Read();
488  case kXR_readv: return do_ReadV();
489  case kXR_write: return do_Write();
490  case kXR_writev: return do_WriteV();
491  case kXR_pgread: return do_PgRead();
492  case kXR_pgwrite: return do_PgWrite();
494  return do_Sync();
496  return do_Close();
497  case kXR_stat: if (!Request.header.dlen)
499  return do_Stat();
500  }
501  break;
503  if (!Request.header.dlen) return do_Truncate();
504  break;
505  case kXR_query: if (!Request.header.dlen) return do_Qfh();
506  break;
507  case kXR_chkpoint: return do_ChkPnt();
508  case kXR_clone: return do_Clone();
509  default: break;
510  }
511 
512 // Now select the requests that do not need authentication
513 //
514  switch(Request.header.requestid)
515  {case kXR_protocol: return do_Protocol(); // dlen ignored
516  case kXR_ping: return do_Ping(); // dlen ignored
517  default: break;
518  }
519 
520 // Force authentication at this point, if need be
521 //
522  if (Status & XRD_NEED_AUTH)
523  {int rc;
524  if (Request.header.requestid == kXR_auth) rc = do_Auth();
526  "Invalid request; user not authenticated");
527  rc = -1;
528  }
530  return rc;
531  }
532 
533 // Construct request ID as the following functions are async eligible
534 //
536 
537 // Process items that don't need arguments but may have them
538 //
539  switch(Request.header.requestid)
540  {case kXR_endsess: return do_Endsess();
541  default: break;
542  }
543 
544 // All remaining requests require an argument. Make sure we have one
545 //
546  if (!argp || !Request.header.dlen)
547  {Response.Send(kXR_ArgMissing, "Required argument not present");
548  return 0;
549  }
550 
551 // All of the subsequent requests can be redirected and are subject to
552 // prefunctory redirection which we check here.
553 //
554  if (CL_Redir && !Link->hasBridge())
555  {bool doRdr = false;
556  if (Link->AddrInfo()->isPrivate()) rdType = 1;
557  if (RouteClient.pvtIP && rdType) doRdr = true;
559  doRdr = true;
560  else if (RouteClient.DomCnt)
561  {XrdOucString hName = Link->Host();
562  for (int i = 0; i < RouteClient.DomCnt; i++)
563  {if (hName.endswith(RouteClient.Domain[i]))
564  {doRdr = true; break;}
565  }
566  }
567  if (doRdr)
568  {Response.Send(kXR_redirect,Route[RD_client].Port[rdType],
569  Route[RD_client].Host[rdType]);
570  return -1;
571  }
572  }
573 
574 // Process items that keep own statistics
575 //
576  switch(Request.header.requestid)
577  {case kXR_open: return do_Open();
578  case kXR_gpfile: return do_gpFile();
579  default: break;
580  }
581 
582 // Update misc stats count
583 //
584  SI->Bump(SI->miscCnt);
585 
586 // Now process whatever we have
587 //
588  switch(Request.header.requestid)
589  {case kXR_chmod: return do_Chmod();
590  case kXR_dirlist: return do_Dirlist();
591  case kXR_fattr: return do_FAttr();
592  case kXR_locate: return do_Locate();
593  case kXR_mkdir: return do_Mkdir();
594  case kXR_mv: return do_Mv();
595  case kXR_query: return do_Query();
596  case kXR_prepare: return do_Prepare();
597  case kXR_rm: return do_Rm();
598  case kXR_rmdir: return do_Rmdir();
599  case kXR_set: return do_Set();
600  case kXR_stat: return do_Stat();
601  case kXR_statx: return do_Statx();
602  case kXR_truncate: return do_Truncate();
603  default: break;
604  }
605 
606 // Whatever we have, it's not valid
607 //
608  Response.Send(kXR_InvalidRequest, "Invalid request code");
609  return 0;
610 }
@ kXR_InvalidRequest
Definition: XProtocol.hh:1038
@ kXR_ArgMissing
Definition: XProtocol.hh:1033
@ kXR_SigVerErr
Definition: XProtocol.hh:1054
@ kXR_redirect
Definition: XProtocol.hh:946
@ kXR_read
Definition: XProtocol.hh:126
@ kXR_open
Definition: XProtocol.hh:123
@ kXR_writev
Definition: XProtocol.hh:144
@ kXR_clone
Definition: XProtocol.hh:145
@ kXR_readv
Definition: XProtocol.hh:138
@ kXR_mkdir
Definition: XProtocol.hh:121
@ kXR_sync
Definition: XProtocol.hh:129
@ kXR_chmod
Definition: XProtocol.hh:115
@ kXR_bind
Definition: XProtocol.hh:137
@ kXR_dirlist
Definition: XProtocol.hh:117
@ kXR_fattr
Definition: XProtocol.hh:133
@ kXR_rm
Definition: XProtocol.hh:127
@ kXR_query
Definition: XProtocol.hh:114
@ kXR_gpfile
Definition: XProtocol.hh:118
@ kXR_login
Definition: XProtocol.hh:120
@ kXR_auth
Definition: XProtocol.hh:113
@ kXR_endsess
Definition: XProtocol.hh:136
@ kXR_set
Definition: XProtocol.hh:131
@ kXR_rmdir
Definition: XProtocol.hh:128
@ kXR_statx
Definition: XProtocol.hh:135
@ kXR_truncate
Definition: XProtocol.hh:141
@ kXR_protocol
Definition: XProtocol.hh:119
@ kXR_mv
Definition: XProtocol.hh:122
@ kXR_ping
Definition: XProtocol.hh:124
@ kXR_stat
Definition: XProtocol.hh:130
@ kXR_pgread
Definition: XProtocol.hh:143
@ kXR_chkpoint
Definition: XProtocol.hh:125
@ kXR_locate
Definition: XProtocol.hh:140
@ kXR_close
Definition: XProtocol.hh:116
@ kXR_prepare
Definition: XProtocol.hh:134
#define XRD_NEED_AUTH
static bool InDomain(XrdNetAddrInfo *epaddr)
Definition: XrdNetIF.cc:622
bool endswith(char c)
virtual const char * Verify(SecurityRequest &secreq, ClientRequest &thereq, const char *thedata)
static void ClearErrorQueue()
Clear the SSL error queue for the calling thread.
Definition: XrdTls.cc:265
SecurityRequest sigReq
static struct XrdXrootdProtocol::RC_Table RouteClient
XrdXrootdReqID ReqID
void setID(unsigned long long id)

References XrdLink::AddrInfo(), XrdXrootdStats::aokSCnt, argp, XrdXrootdStats::badSCnt, XrdBuffer::buff, XrdOucStats::Bump(), CL_Redir, XrdTls::ClearErrorQueue(), ClientRequestHdr::dlen, XrdXrootdProtocol::RC_Table::Domain, XrdXrootdProtocol::RC_Table::DomCnt, eDest, XrdSysError::Emsg(), XrdOucString::endswith(), XrdLink::hasBridge(), ClientRequest::header, XrdLink::Host(), XrdXrootdStats::ignSCnt, XrdNetIF::InDomain(), XrdNetAddrInfo::isPrivate(), kXR_ArgMissing, kXR_auth, kXR_bind, kXR_chkpoint, kXR_chmod, kXR_clone, kXR_close, kXR_dirlist, kXR_endsess, kXR_fattr, kXR_gpfile, kXR_InvalidRequest, kXR_locate, kXR_login, kXR_mkdir, kXR_mv, kXR_open, kXR_pgread, kXR_pgwrite, kXR_ping, kXR_prepare, kXR_protocol, kXR_query, kXR_read, kXR_readv, kXR_redirect, kXR_rm, kXR_rmdir, kXR_set, kXR_SigVerErr, kXR_stat, kXR_statx, kXR_sync, kXR_truncate, kXR_write, kXR_writev, XrdXrootdProtocol::RC_Table::lclDom, Link, XrdXrootdStats::miscCnt, Port, Protect, XrdXrootdProtocol::RC_Table::pvtIP, rdType, ReqID, XProtocol::reqName(), Request, ClientRequestHdr::requestid, Response, Route, RouteClient, XrdXrootdResponse::Send(), XrdLink::setEtext(), XrdXrootdReqID::setID(), SI, sigHere, sigNeed, sigReq, sigReq2Ver, sigWarn, Status, ClientRequestHdr::streamid, tlsCtx, TRACEP, XrdSecProtect::Verify(), and XRD_NEED_AUTH.

Referenced by XrdXrootdTransit::Process(), Process(), XrdXrootdTransit::Redrive(), and XrdXrootdTransit::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcSig()

int XrdXrootdProtocol::ProcSig ( )

Definition at line 616 of file XrdXrootdProtocol.cc.

617 {
618  int rc;
619 
620 // Check if we completed reading the signature and if so, we are done
621 //
622  if (sigRead)
623  {sigRead = false;
624  sigHere = true;
625  return 0;
626  }
627 
628 // Verify that the hash is not longer that what we support and is present
629 //
630  if (Request.header.dlen <= 0
631  || Request.header.dlen > (int)sizeof(sigBuff))
632  {Response.Send(kXR_ArgInvalid, "Invalid signature data length");
633  return Link->setEtext("signature data length error");
634  }
635 
636 // Save relevant information for the next round
637 //
638  memcpy(&sigReq, &Request, sizeof(ClientSigverRequest));
639  sigReq.header.dlen = htonl(Request.header.dlen);
640 
641 // Now read in the signature
642 //
643  sigRead = true;
644  if ((rc = getData("arg", sigBuff, Request.header.dlen)))
645  {Resume = &XrdXrootdProtocol::ProcSig; return rc;}
646  sigRead = false;
647 
648 // All done
649 //
650  sigHere = true;
651  return 0;
652 }
struct ClientRequestHdr header
Definition: XProtocol.hh:923

References ClientRequestHdr::dlen, getData(), ClientRequest::header, SecurityRequest::header, kXR_ArgInvalid, Link, Request, Response, Resume, XrdXrootdResponse::Send(), XrdLink::setEtext(), sigBuff, sigHere, sigRead, and sigReq.

Referenced by Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Reclaim()

void XrdXrootdProtocol::Reclaim ( XrdSfsXioHandle  h)
static

Definition at line 926 of file XrdXrootdProtocol.cc.

927 {
928 
929  if (h) BPool->Release((XrdBuffer *)h);
930 }

References BPool, and XrdBuffManager::Release().

+ Here is the call graph for this function:

◆ Recycle()

void XrdXrootdProtocol::Recycle ( XrdLink lp,
int  consec,
const char *  reason 
)
overridevirtual

Implements XrdProtocol.

Reimplemented in XrdXrootdTransit.

Definition at line 661 of file XrdXrootdProtocol.cc.

662 {
663  char *sfxp, ctbuff[24], buff[128], Flags = (reason ? XROOTD_MON_FORCED : 0);
664  const char *What;
665  XrdSysMutexHelper recycleHelper(unbindMutex);
666 
667 // Check for disconnect or unbind
668 //
669  if (Status == XRD_BOUNDPATH) {What = "unbind"; Flags |= XROOTD_MON_BOUNDP;}
670  else What = "disc";
671 
672 // Document the disconnect or undind
673 //
674  if (lp)
675  {XrdSysTimer::s2hms(csec, ctbuff, sizeof(ctbuff));
676  if (reason && strcmp(reason, "hangup"))
677  {snprintf(buff, sizeof(buff), "%s (%s)", ctbuff, reason);
678  sfxp = buff;
679  } else sfxp = ctbuff;
680 
681  eDest.Log(SYS_LOG_02, "Xeq", lp->ID, (char *)What, sfxp);
682  }
683 
684 // Handle any waiting read on this link. This is a tricky proposition because
685 // we don't know if the thread is waiting to run or not. However, we will
686 // indicate that gdFail was already called and should the thread run, it will
687 // promptly exit should it ever run again. That way, we handle the cleanup.
688 //
692 
693 // If this is a bound stream then we cannot release the resources until
694 // all activity ceases on this stream (i.e., lp == 0). This is only relevant for
695 // writes that read from the link. if we are still tagged as active and not
696 // waiting for link activity then ask to be signalled once activity stops.
697 // Otherwise, redrive the parallel I/O so that it cleans up.
698 //
699  if (lp && Status == XRD_BOUNDPATH)
700  {streamMutex.Lock();
701  isNOP = true;
702  if (isActive)
703  {if (isLinkWT)
704  {streamMutex.UnLock();
705  do_OffloadIO();
706  } else {
707  while(isActive)
708  {XrdSysCondVar2 aioDone(streamMutex);
709  endNote = &aioDone;
710  aioDone.Wait();
711  endNote = 0;
712  }
714  }
715  } else streamMutex.UnLock();
716  boundRecycle->Post();
717  if (lp) return; // Async close
718  }
719 
720 // Release all appendages
721 //
722  Cleanup();
723 
724 // If we are monitoring logins then we are also monitoring disconnects. We do
725 // this after cleanup so that close records can be generated before we cut a
726 // disconnect record. This then requires we clear the monitor object here.
727 // We and the destrcutor are the only ones who call cleanup and a deletion
728 // will call the monitor clear method. So, we won't leak memeory.
729 //
730  if (Monitor.Logins()) Monitor.Agent->Disc(Monitor.Did, csec, Flags);
732  Monitor.Clear();
733 
734 // Set fields to starting point (debugging mostly)
735 //
736  Reset();
737 
738 // Push ourselves on the stack
739 //
740  if (Response.isOurs()) ProtStack.Push(&ProtLink);
741 }
const int SYS_LOG_02
Definition: XrdSysError.hh:101
const kXR_char XROOTD_MON_BOUNDP
const kXR_char XROOTD_MON_FORCED
#define XRD_BOUNDPATH
void Push(XrdObject< T > *Node)
Definition: XrdObject.hh:101
void Log(int mask, const char *esfx, const char *text1, const char *text2=0, const char *text3=0)
Definition: XrdSysError.hh:167
static char * s2hms(int sec, char *buff, int blen)
Definition: XrdSysTimer.cc:192
T fetch_or(T v) noexcept
static void Disc(unsigned int usrID)
void Disc(kXR_unt32 dictid, int csec, char Flags=0)
XrdSysSemaphore * boundRecycle
XrdSysCondVar2 * endNote
XrdXrootd::gdCallBack * CallBack

References XrdXrootdProtocol::GetDataCtl::Active, XrdXrootdMonitor::User::Agent, boundRecycle, XrdXrootdProtocol::GetDataCtl::CallBack, XrdXrootdMonitor::User::Clear(), XrdXrootdMonitor::User::Did, XrdXrootdMonitor::Disc(), XrdXrootdMonFile::Disc(), eDest, endNote, XrdSys::RAtomic< T >::fetch_or(), XrdXrootdMonitor::User::Fstat(), gdCtl, XrdXrootd::gdCallBack::gdFail(), XrdLink::ID, XrdXrootdProtocol::GetDataCtl::inData, XrdXrootdProtocol::GetDataCtl::inDataIov, isActive, isLinkWT, isNOP, XrdXrootdResponse::isOurs(), XrdXrootdProtocol::GetDataCtl::linkWait, XrdSysMutex::Lock(), XrdSysError::Log(), XrdXrootdMonitor::User::Logins(), Monitor, XrdSysSemaphore::Post(), XrdObjectQ< T >::Push(), Response, XrdSysTimer::s2hms(), Status, XrdXrootdProtocol::GetDataCtl::Status, streamMutex, SYS_LOG_02, XrdXrootdProtocol::GetDataCtl::Terminate, unbindMutex, XrdSysMutex::UnLock(), XrdSysCondVar2::Wait(), XRD_BOUNDPATH, XROOTD_MON_BOUNDP, and XROOTD_MON_FORCED.

Referenced by XrdXrootdTransit::Disc(), and XrdXrootdTransit::Recycle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RequestClose()

bool XrdXrootdProtocol::RequestClose ( )
protected

Definition at line 1551 of file XrdXrootdProtocol.cc.

1552 {
1554  if (CloseRequested) return false;
1555  CloseRequested = true;
1556  return true;
1557 }

References CloseRequested, and unbindMutex.

Referenced by CloseRequestCb().

+ Here is the caller graph for this function:

◆ SendFile() [1/2]

int XrdXrootdProtocol::SendFile ( int  fildes)
overridevirtual

Send data to a client using the sendfile() system interface.

Parameters
fildes- The file descriptor to use to effect a sendfile() for all of the requested data. The original offset and length are used relative to this file descriptor.
Returns
>0 - data has been sent in a previous call. This is indicative of a logic error in SendData() as only one call is allowed.
=0 - data has been sent.
<0 - A fatal transmission error occurred. SendData() should return SFS_ERROR to force the connection to be closed.

Implements XrdSfsDio.

Definition at line 3832 of file XrdXrootdXeq.cc.

3833 {
3834 
3835 // Make sure we have some data to send
3836 //
3837  if (!IO.IOLen) return 1;
3838 
3839 // Send off the data
3840 //
3841  IO.IOLen = Response.Send(fildes, IO.Offset, IO.IOLen);
3842  return IO.IOLen;
3843 }

References IO, XrdXrootd::IOParms::IOLen, Response, and XrdXrootdResponse::Send().

+ Here is the call graph for this function:

◆ SendFile() [2/2]

int XrdXrootdProtocol::SendFile ( XrdOucSFVec sfvec,
int  sfvnum 
)
overridevirtual

Send data to a client using the sendfile() system interface.

Parameters
sfvec- One or more XrdOucSFVec elements describing what should be transferred. The first element of the vector must be available for use by the interface for proper framing. That is, start filling in elements at sfvec[1] and sfvnum should be the count of elements filled in plus 1.
sfvnum- total number of elements in sfvec and includes the first unused element. There is a maximum number of elements that the vector may have; defined inside XrdOucSFVec.
Returns
>0 - either data has been sent in a previous call or the total amount of data in sfvec is greater than the original request. This is indicative of a SendData() logic error.
=0 - data has been sent.
<0 - A fatal transmission error occurred. SendData() should return SFS_ERROR to force the connection to be closed.

Implements XrdSfsDio.

Definition at line 3847 of file XrdXrootdXeq.cc.

3848 {
3849  int i, xframt = 0;
3850 
3851 // Make sure we have some data to send
3852 //
3853  if (!IO.IOLen) return 1;
3854 
3855 // Verify the length, it can't be greater than what the client wants
3856 //
3857  for (i = 1; i < sfvnum; i++) xframt += sfvec[i].sendsz;
3858  if (xframt > IO.IOLen) return 1;
3859 
3860 // Send off the data
3861 //
3862  if (xframt) IO.IOLen = Response.Send(sfvec, sfvnum, xframt);
3863  else {IO.IOLen = 0; Response.Send();}
3864  return IO.IOLen;
3865 }

References IO, XrdXrootd::IOParms::IOLen, Response, and XrdXrootdResponse::Send().

+ Here is the call graph for this function:

◆ SetFD()

void XrdXrootdProtocol::SetFD ( int  fildes)
overridevirtual

Change the file descriptor setting and, consequently, interface processing.

Parameters
fildes- The file descriptor to use in the future, as follows: < 0 - Disable sendfile and always use read(). >= 0 - Enable sendfile and always use sendfile() w/o invoking this interface (i.e. fast path).

Implements XrdSfsDio.

Definition at line 3871 of file XrdXrootdXeq.cc.

3872 {
3873  if (fildes < 0) IO.File->sfEnabled = 0;
3874  else IO.File->fdNum = fildes;
3875 }

References XrdXrootd::IOParms::File, IO, and XrdXrootdFile::sfEnabled.

◆ SetSF()

int XrdXrootdProtocol::SetSF ( kXR_char fhandle,
bool  seton = false 
)
protected

Definition at line 4414 of file XrdXrootdXeq.cc.

4415 {
4416  XrdXrootdFHandle fh(fhandle);
4417  XrdXrootdFile *theFile;
4418 
4419  if (!FTab || !(theFile = FTab->Get(fh.handle))) return -EBADF;
4420 
4421 // Turn it off or on if so wanted
4422 //
4423  if (!seton) theFile->sfEnabled = 0;
4424  else if (theFile->fdNum >= 0) theFile->sfEnabled = 1;
4425 
4426 // All done
4427 //
4428  return 0;
4429 }

References FTab, XrdXrootdFileTable::Get(), XrdXrootdFHandle::handle, and XrdXrootdFile::sfEnabled.

Referenced by XrdXrootdTransit::setSF().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stats()

int XrdXrootdProtocol::Stats ( char *  buff,
int  blen,
int  do_sync = 0 
)
overridevirtual

Implements XrdProtocol.

Definition at line 857 of file XrdXrootdProtocol.cc.

858 {
859 // Synchronize statistics if need be
860 //
861  if (do_sync)
862  {SI->statsMutex.Lock();
863  SI->readCnt += numReads;
864  cumReads += numReads; numReads = 0;
865  SI->prerCnt += numReadP;
866  cumReadP += numReadP; numReadP = 0;
867 
868  SI->rvecCnt += numReadV;
869  cumReadV += numReadV; numReadV = 0;
870  SI->rsegCnt += numSegsV;
871  cumSegsV += numSegsV; numSegsV = 0;
872 
873  SI->wvecCnt += numWritV;
874  cumWritV += numWritV; numWritV = 0;
875  SI->wsegCnt += numSegsW;
876  cumSegsW += numSegsW, numSegsW = 0;
877 
878  SI->writeCnt += numWrites;
880  SI->statsMutex.UnLock();
881  }
882 
883 // Now return the statistics
884 //
885  return SI->Stats(buff, blen, do_sync);
886 }
XrdSysMutex statsMutex
Definition: XrdOucStats.hh:55
long long rsegCnt
long long wsegCnt
long long readCnt
long long prerCnt
long long rvecCnt
long long writeCnt
long long wvecCnt
int Stats(char *buff, int blen, int do_sync=0)

References cumReadP, cumReads, cumReadV, cumSegsV, cumSegsW, cumWrites, cumWritV, XrdSysMutex::Lock(), numReadP, numReads, numReadV, numSegsV, numSegsW, numWrites, numWritV, XrdXrootdStats::prerCnt, XrdXrootdStats::readCnt, XrdXrootdStats::rsegCnt, XrdXrootdStats::rvecCnt, SI, XrdXrootdStats::Stats(), XrdOucStats::statsMutex, XrdSysMutex::UnLock(), XrdXrootdStats::writeCnt, XrdXrootdStats::wsegCnt, and XrdXrootdStats::wvecCnt.

+ Here is the call graph for this function:

◆ StreamNOP()

void XrdXrootdProtocol::StreamNOP ( )

Definition at line 936 of file XrdXrootdProtocol.cc.

937 {
938 
939 // Mark this stream as not operation if it is not the control strea,
940 //
941  if (PathID)
942  {streamMutex.Lock();
943  isNOP = true;
945  }
946 }

References isNOP, XrdSysMutex::Lock(), PathID, streamMutex, and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

◆ Swap()

XrdSfsXioHandle XrdXrootdProtocol::Swap ( const char *  curBuff,
XrdSfsXioHandle  oldHand = 0 
)
overridevirtual

Swap the current I/O buffer

Parameters
curBuff- The address of the current buffer. It must match the the buffer that was most recently passed to the caller.
oldHand- The handle associated with a buffer returned by a previous call to Swap(). A value of zero indicates that the caller is taking control of the buffer but has no replacement buffer.
Returns
!0 The buffer handle of the current buffer is returned along with ownership rights. If oldHand was not nil, the caller's ownership of the associated buffer is reclaimed.
=0 An error occurred and nothing has changed; errno holds the reason for the error. Typically, EINVAL - curBuff doe not match current buffer. ENOBUFS - not enough memory to give up buffer. ENOTSUP - unsupported context for call.

Implements XrdSfsXio.

Definition at line 952 of file XrdXrootdProtocol.cc.

953 {
954  XrdBuffer *oldBP = argp;
955 
956 // Verify the context and linkage and if OK, swap buffers
957 //
958  if (Request.header.requestid != kXR_write) errno = ENOTSUP;
959  else if (buff != argp->buff) errno = EINVAL;
960  else {if (h)
961  {argp = (XrdBuffer *)h;
962  return oldBP;
963  } else {
964  argp = BPool->Obtain(argp->bsize);
965  if (argp) return oldBP;
966  argp = oldBP;
967  errno = ENOBUFS;
968  }
969  }
970  return 0;
971 }

References argp, BPool, XrdBuffer::bsize, XrdBuffer::buff, ClientRequest::header, kXR_write, XrdBuffManager::Obtain(), Request, and ClientRequestHdr::requestid.

Referenced by Claim().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerifyStream()

XrdXrootdProtocol * XrdXrootdProtocol::VerifyStream ( int &  rc,
int  pID,
bool  lok = true 
)

Definition at line 977 of file XrdXrootdProtocol.cc.

978 {
979  XrdXrootdProtocol *pp;
980 
981 // Verify that the path actually exists
982 //
983  if (pID >= maxStreams || !(pp = Stream[pID]))
984  {rc = Response.Send(kXR_ArgInvalid, "invalid path ID");
985  return 0;
986  }
987 
988 // Verify that this path is still functional
989 //
990  pp->streamMutex.Lock();
991  if (pp->isNOP)
992  {pp->streamMutex.UnLock();
993  rc = Response.Send(kXR_ArgInvalid, "path ID is not operational");
994  return 0;
995  }
996 
997 // All done!
998 //
999  if (!lok) pp->streamMutex.UnLock();
1000  return pp;
1001 }
XrdXrootdProtocol * Stream[maxStreams]
static const int maxStreams

References isNOP, kXR_ArgInvalid, XrdSysMutex::Lock(), maxStreams, Response, XrdXrootdResponse::Send(), Stream, streamMutex, and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ XrdXrootdAdmin

friend class XrdXrootdAdmin
friend

Definition at line 160 of file XrdXrootdProtocol.hh.

Member Data Documentation

◆ ableTLS

bool XrdXrootdProtocol::ableTLS
protected

Definition at line 624 of file XrdXrootdProtocol.hh.

◆ AdminSock

XrdNetSocket * XrdXrootdProtocol::AdminSock = 0
staticprotected

Definition at line 426 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ AppName

char* XrdXrootdProtocol::AppName
protected

Definition at line 534 of file XrdXrootdProtocol.hh.

◆ argp

XrdBuffer* XrdXrootdProtocol::argp
protected

Definition at line 515 of file XrdXrootdProtocol.hh.

Referenced by Claim(), Process(), Process2(), XrdXrootdTransit::Run(), and Swap().

◆ as_aioOK

bool XrdXrootdProtocol::as_aioOK = true
static

Definition at line 232 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ as_force

bool XrdXrootdProtocol::as_force = false
static

Definition at line 231 of file XrdXrootdProtocol.hh.

◆ as_maxperlnk

int XrdXrootdProtocol::as_maxperlnk = 8
static

Definition at line 221 of file XrdXrootdProtocol.hh.

◆ as_maxperreq

int XrdXrootdProtocol::as_maxperreq = 8
static

Definition at line 222 of file XrdXrootdProtocol.hh.

◆ as_maxpersrv

int XrdXrootdProtocol::as_maxpersrv = 4096
static

Definition at line 223 of file XrdXrootdProtocol.hh.

◆ as_maxstalls

int XrdXrootdProtocol::as_maxstalls = 4
static

Definition at line 228 of file XrdXrootdProtocol.hh.

◆ as_miniosz

int XrdXrootdProtocol::as_miniosz = 98304
static

Definition at line 224 of file XrdXrootdProtocol.hh.

◆ as_minsfsz

int XrdXrootdProtocol::as_minsfsz = 8192
static

Definition at line 225 of file XrdXrootdProtocol.hh.

◆ as_nosf

bool XrdXrootdProtocol::as_nosf = false
static

Definition at line 233 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ as_okstutter

short XrdXrootdProtocol::as_okstutter = 1
static

Definition at line 229 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ as_seghalf

int XrdXrootdProtocol::as_seghalf = 32768
static

Definition at line 226 of file XrdXrootdProtocol.hh.

◆ as_segsize

int XrdXrootdProtocol::as_segsize = 65536
static

Definition at line 227 of file XrdXrootdProtocol.hh.

Referenced by XrdXrootdAioBuff::Alloc(), and Configure().

◆ as_syncw

bool XrdXrootdProtocol::as_syncw = false
static

Definition at line 234 of file XrdXrootdProtocol.hh.

◆ as_timeout

short XrdXrootdProtocol::as_timeout = 45
static

Definition at line 230 of file XrdXrootdProtocol.hh.

◆ AuthProt

XrdSecProtocol* XrdXrootdProtocol::AuthProt
protected

Definition at line 531 of file XrdXrootdProtocol.hh.

◆ boundRecycle

XrdSysSemaphore* XrdXrootdProtocol::boundRecycle
protected

Definition at line 605 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ BPool

XrdBuffManager * XrdXrootdProtocol::BPool
staticprotected

Definition at line 405 of file XrdXrootdProtocol.hh.

Referenced by Configure(), Process(), Reclaim(), and Swap().

◆ CapVer

unsigned char XrdXrootdProtocol::CapVer
protected

Definition at line 525 of file XrdXrootdProtocol.hh.

◆ CIA

XrdSecService * XrdXrootdProtocol::CIA = 0
staticprotected

Definition at line 400 of file XrdXrootdProtocol.hh.

◆ CL_Redir

bool XrdXrootdProtocol::CL_Redir = false
staticprotected

Definition at line 463 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ Client

XrdSecEntity* XrdXrootdProtocol::Client
protected

Definition at line 530 of file XrdXrootdProtocol.hh.

Referenced by MonAuth().

◆ clientPV

int XrdXrootdProtocol::clientPV
protected

Definition at line 519 of file XrdXrootdProtocol.hh.

Referenced by MonAuth().

◆ clientRN

int XrdXrootdProtocol::clientRN
protected

Definition at line 520 of file XrdXrootdProtocol.hh.

◆ CloseRequested

bool XrdXrootdProtocol::CloseRequested
protected

Definition at line 526 of file XrdXrootdProtocol.hh.

Referenced by RequestClose().

◆ cumReadP

int XrdXrootdProtocol::cumReadP
protected

Definition at line 503 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumReads

int XrdXrootdProtocol::cumReads
protected

Definition at line 502 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumReadV

int XrdXrootdProtocol::cumReadV
protected

Definition at line 504 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumSegsV

int XrdXrootdProtocol::cumSegsV
protected

Definition at line 505 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumSegsW

int XrdXrootdProtocol::cumSegsW
protected

Definition at line 507 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumWrites

int XrdXrootdProtocol::cumWrites
protected

Definition at line 508 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumWritV

int XrdXrootdProtocol::cumWritV
protected

Definition at line 506 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ DHS

XrdSecProtector * XrdXrootdProtocol::DHS = 0
staticprotected

Definition at line 401 of file XrdXrootdProtocol.hh.

◆ digFS

XrdSfsFileSystem * XrdXrootdProtocol::digFS = 0
staticprotected

Definition at line 399 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ doTLS

char XrdXrootdProtocol::doTLS
protected

Definition at line 623 of file XrdXrootdProtocol.hh.

◆ eDest

XrdSysError & XrdXrootdProtocol::eDest = XrdXrootd::eLog
staticprotected

Definition at line 406 of file XrdXrootdProtocol.hh.

Referenced by Configure(), Process2(), and Recycle().

◆ endNote

XrdSysCondVar2* XrdXrootdProtocol::endNote
protected

Definition at line 606 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ Entity

XrdSecEntity XrdXrootdProtocol::Entity
protected

Definition at line 532 of file XrdXrootdProtocol.hh.

Referenced by Match(), and MonAuth().

◆ fsFeatures

uint64_t XrdXrootdProtocol::fsFeatures = 0
staticprotected

Definition at line 446 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ FTab

XrdXrootdFileTable* XrdXrootdProtocol::FTab
protected

Definition at line 516 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), and SetSF().

◆ gdCtl

struct XrdXrootdProtocol::GetDataCtl XrdXrootdProtocol::gdCtl
protected

Referenced by getDump(), and Recycle().

◆ hailWait

int XrdXrootdProtocol::hailWait
staticprotected

Definition at line 430 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Match().

◆ halfBSize

int XrdXrootdProtocol::halfBSize
protected

Definition at line 598 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ hcMax

int XrdXrootdProtocol::hcMax = 28657
staticprotected

Definition at line 594 of file XrdXrootdProtocol.hh.

◆ hcNext

int XrdXrootdProtocol::hcNext
protected

Definition at line 596 of file XrdXrootdProtocol.hh.

◆ hcNow

int XrdXrootdProtocol::hcNow
protected

Definition at line 597 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ hcPrev

int XrdXrootdProtocol::hcPrev
protected

Definition at line 595 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ IO

XrdXrootd::IOParms XrdXrootdProtocol::IO
protected

Definition at line 590 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), SendFile(), and SetFD().

◆ isActive

bool XrdXrootdProtocol::isActive
protected

Definition at line 609 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ isLinkWT

bool XrdXrootdProtocol::isLinkWT
protected

Definition at line 610 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ isNOP

bool XrdXrootdProtocol::isNOP
protected

Definition at line 611 of file XrdXrootdProtocol.hh.

Referenced by Recycle(), StreamNOP(), and VerifyStream().

◆ isProxy

bool XrdXrootdProtocol::isProxy = false
staticprotected

Definition at line 465 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ isRedir

char XrdXrootdProtocol::isRedir = 0
staticprotected

Definition at line 439 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Match().

◆ isTLS

bool XrdXrootdProtocol::isTLS
protected

Definition at line 625 of file XrdXrootdProtocol.hh.

◆ JobCKCGI

char XrdXrootdProtocol::JobCKCGI =0
staticprotected

Definition at line 441 of file XrdXrootdProtocol.hh.

◆ JobCKS

XrdXrootdJob * XrdXrootdProtocol::JobCKS = 0
staticprotected

Definition at line 442 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobCKT

char * XrdXrootdProtocol::JobCKT = 0
staticprotected

Definition at line 443 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobCKTLST

XrdOucTList * XrdXrootdProtocol::JobCKTLST = 0
staticprotected

Definition at line 444 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobLCL

char XrdXrootdProtocol::JobLCL = 0
staticprotected

Definition at line 440 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ keepT

time_t XrdXrootdProtocol::keepT = 86400
staticprotected

Definition at line 422 of file XrdXrootdProtocol.hh.

◆ LimitError

bool XrdXrootdProtocol::LimitError = true
staticprotected

Definition at line 630 of file XrdXrootdProtocol.hh.

◆ Link

◆ linkAioReq

RAtomic_int XrdXrootdProtocol::linkAioReq
protected

Definition at line 548 of file XrdXrootdProtocol.hh.

Referenced by aioUpdReq().

◆ Locker

XrdXrootdFileLock * XrdXrootdProtocol::Locker
staticprotected

Definition at line 403 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxBuffsz

int XrdXrootdProtocol::maxBuffsz
staticprotected

Definition at line 486 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxPio

const int XrdXrootdProtocol::maxPio = 4
staticprotected

Definition at line 613 of file XrdXrootdProtocol.hh.

◆ maxReadv_ior

int XrdXrootdProtocol::maxReadv_ior
staticprotected
Initial value:

Definition at line 488 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxStreams

const int XrdXrootdProtocol::maxStreams = 16
static

Definition at line 217 of file XrdXrootdProtocol.hh.

Referenced by VerifyStream().

◆ maxTransz

int XrdXrootdProtocol::maxTransz = 262144
staticprotected

Definition at line 487 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Monitor

XrdXrootdMonitor::User XrdXrootdProtocol::Monitor
protected

Definition at line 517 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), MonAuth(), and Recycle().

◆ myBlast

int XrdXrootdProtocol::myBlast
protected

Definition at line 556 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan().

◆ myBlen

int XrdXrootdProtocol::myBlen
protected

Definition at line 555 of file XrdXrootdProtocol.hh.

Referenced by Process(), and XrdXrootdTransit::Run().

◆ myBuff

char* XrdXrootdProtocol::myBuff
protected

Definition at line 554 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), Process(), and XrdXrootdTransit::Run().

◆ myCName

const char * XrdXrootdProtocol::myCName = 0
staticprotected

Definition at line 437 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myCNlen

int XrdXrootdProtocol::myCNlen = 0
staticprotected

Definition at line 438 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myGID

gid_t XrdXrootdProtocol::myGID = 0
staticprotected

Definition at line 416 of file XrdXrootdProtocol.hh.

◆ myGName

const char * XrdXrootdProtocol::myGName = "?"
staticprotected

Definition at line 420 of file XrdXrootdProtocol.hh.

◆ myGNLen

int XrdXrootdProtocol::myGNLen = 1
staticprotected

Definition at line 418 of file XrdXrootdProtocol.hh.

◆ myInst

const char * XrdXrootdProtocol::myInst = 0
staticprotected

Definition at line 409 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myPID

int XrdXrootdProtocol::myPID = static_cast<int>(getpid())
staticprotected

Definition at line 412 of file XrdXrootdProtocol.hh.

◆ myRole

int XrdXrootdProtocol::myRole = 0
staticprotected

Definition at line 413 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myRolf

int XrdXrootdProtocol::myRolf = 0
staticprotected

Definition at line 414 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ mySID

unsigned int XrdXrootdProtocol::mySID
protected

Definition at line 608 of file XrdXrootdProtocol.hh.

◆ myStalls

int XrdXrootdProtocol::myStalls
protected

Definition at line 509 of file XrdXrootdProtocol.hh.

◆ myUID

uid_t XrdXrootdProtocol::myUID = 0
staticprotected

Definition at line 417 of file XrdXrootdProtocol.hh.

◆ myUName

const char * XrdXrootdProtocol::myUName = "?"
staticprotected

Definition at line 421 of file XrdXrootdProtocol.hh.

◆ myUNLen

int XrdXrootdProtocol::myUNLen = 1
staticprotected

Definition at line 419 of file XrdXrootdProtocol.hh.

◆ newPio

bool XrdXrootdProtocol::newPio
protected

Definition at line 619 of file XrdXrootdProtocol.hh.

◆ Notify

char * XrdXrootdProtocol::Notify = 0
staticprotected

Definition at line 436 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ numFiles

int XrdXrootdProtocol::numFiles
protected

Definition at line 500 of file XrdXrootdProtocol.hh.

◆ numReadP

int XrdXrootdProtocol::numReadP
protected

Definition at line 494 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numReads

int XrdXrootdProtocol::numReads
protected

Definition at line 493 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numReadV

int XrdXrootdProtocol::numReadV
protected

Definition at line 495 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numSegsV

int XrdXrootdProtocol::numSegsV
protected

Definition at line 496 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numSegsW

int XrdXrootdProtocol::numSegsW
protected

Definition at line 498 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numWrites

int XrdXrootdProtocol::numWrites
protected

Definition at line 499 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), and Stats().

◆ numWritV

int XrdXrootdProtocol::numWritV
protected

Definition at line 497 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ OD_Bypass

bool XrdXrootdProtocol::OD_Bypass = false
staticprotected

Definition at line 460 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ OD_Redir

bool XrdXrootdProtocol::OD_Redir = false
staticprotected

Definition at line 461 of file XrdXrootdProtocol.hh.

◆ OD_Stall

int XrdXrootdProtocol::OD_Stall = 33
staticprotected

Definition at line 459 of file XrdXrootdProtocol.hh.

◆ osFS

XrdSfsFileSystem * XrdXrootdProtocol::osFS
staticprotected

Definition at line 398 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ PathID

short XrdXrootdProtocol::PathID
protected

Definition at line 618 of file XrdXrootdProtocol.hh.

Referenced by getPathID(), and StreamNOP().

◆ pgwCtl

XrdXrootdPgwCtl* XrdXrootdProtocol::pgwCtl
protected

Definition at line 553 of file XrdXrootdProtocol.hh.

◆ pioFirst

XrdXrootdPio* XrdXrootdProtocol::pioFirst
protected

Definition at line 614 of file XrdXrootdProtocol.hh.

◆ pioFree

XrdXrootdPio* XrdXrootdProtocol::pioFree
protected

Definition at line 616 of file XrdXrootdProtocol.hh.

◆ pioLast

XrdXrootdPio* XrdXrootdProtocol::pioLast
protected

Definition at line 615 of file XrdXrootdProtocol.hh.

◆ PMark

XrdNetPMark * XrdXrootdProtocol::PMark = 0
staticprotected

Definition at line 407 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ pmDone

bool XrdXrootdProtocol::pmDone
protected

Definition at line 521 of file XrdXrootdProtocol.hh.

◆ pmHandle

XrdNetPMark::Handle* XrdXrootdProtocol::pmHandle
protected

Definition at line 518 of file XrdXrootdProtocol.hh.

◆ Port

int XrdXrootdProtocol::Port
staticprotected

Definition at line 432 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ PrepareAlt

bool XrdXrootdProtocol::PrepareAlt = false
staticprotected

Definition at line 629 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ PrepareCount

int XrdXrootdProtocol::PrepareCount
protected

Definition at line 632 of file XrdXrootdProtocol.hh.

◆ PrepareLimit

int XrdXrootdProtocol::PrepareLimit = -1
staticprotected

Definition at line 633 of file XrdXrootdProtocol.hh.

◆ PrepID

XrdOucReqID * XrdXrootdProtocol::PrepID = 0
staticprotected

Definition at line 445 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Protect

XrdSecProtect* XrdXrootdProtocol::Protect
protected

Definition at line 533 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ rdType

short XrdXrootdProtocol::rdType
protected

Definition at line 523 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ readWait

int XrdXrootdProtocol::readWait
staticprotected

Definition at line 431 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ redirIPHold

int XrdXrootdProtocol::redirIPHold = 8*60*60
staticprotected

Definition at line 435 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ RedirPI

XrdXrootdRedirPI * XrdXrootdProtocol::RedirPI = 0
staticprotected

Definition at line 408 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Req_TLSData

const char XrdXrootdProtocol::Req_TLSData = 0x01
staticprotected

Definition at line 475 of file XrdXrootdProtocol.hh.

◆ Req_TLSGPFile

const char XrdXrootdProtocol::Req_TLSGPFile = 0x02
staticprotected

Definition at line 476 of file XrdXrootdProtocol.hh.

◆ Req_TLSLogin

const char XrdXrootdProtocol::Req_TLSLogin = 0x04
staticprotected

Definition at line 477 of file XrdXrootdProtocol.hh.

◆ Req_TLSSess

const char XrdXrootdProtocol::Req_TLSSess = 0x08
staticprotected

Definition at line 478 of file XrdXrootdProtocol.hh.

◆ Req_TLSTPC

const char XrdXrootdProtocol::Req_TLSTPC = 0x10
staticprotected

Definition at line 479 of file XrdXrootdProtocol.hh.

◆ ReqID

XrdXrootdReqID XrdXrootdProtocol::ReqID
protected

Definition at line 637 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ Request

ClientRequest XrdXrootdProtocol::Request
protected

◆ reserved

char XrdXrootdProtocol::reserved[3]
protected

Definition at line 522 of file XrdXrootdProtocol.hh.

◆ Response

XrdXrootdResponse XrdXrootdProtocol::Response
protected

◆ Resume

int(XrdXrootdProtocol::* XrdXrootdProtocol::Resume) ()
protected

◆ ResumePio

int(XrdXrootdProtocol::* XrdXrootdProtocol::ResumePio) ()
protected

Definition at line 588 of file XrdXrootdProtocol.hh.

◆ reTry

XrdSysSemaphore* XrdXrootdProtocol::reTry
protected

Definition at line 604 of file XrdXrootdProtocol.hh.

◆ Route

struct XrdXrootdProtocol::RD_Table XrdXrootdProtocol::Route[RD_Num]
staticprotected

Referenced by Configure(), and Process2().

◆ RouteClient

struct XrdXrootdProtocol::RC_Table XrdXrootdProtocol::RouteClient
staticprotected

Referenced by Process2().

◆ RPList

XrdXrootdXPath XrdXrootdProtocol::RPList
staticprotected

Definition at line 395 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ RQList

XrdXrootdXPath XrdXrootdProtocol::RQList
staticprotected

Definition at line 396 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ RQLxist

int XrdXrootdProtocol::RQLxist = 0
staticprotected

Definition at line 411 of file XrdXrootdProtocol.hh.

◆ rvSeq

unsigned char XrdXrootdProtocol::rvSeq
protected

Definition at line 620 of file XrdXrootdProtocol.hh.

◆ Sched

XrdScheduler * XrdXrootdProtocol::Sched
staticprotected

Definition at line 404 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and XrdXrootdTransit::Recycle().

◆ SI

XrdXrootdStats * XrdXrootdProtocol::SI
staticprotected

Definition at line 492 of file XrdXrootdProtocol.hh.

Referenced by Configure(), Match(), Process2(), and Stats().

◆ sigBuff

char XrdXrootdProtocol::sigBuff[64]
protected

Definition at line 540 of file XrdXrootdProtocol.hh.

Referenced by ProcSig().

◆ sigHere

bool XrdXrootdProtocol::sigHere
protected

Definition at line 542 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and ProcSig().

◆ sigNeed

bool XrdXrootdProtocol::sigNeed
protected

Definition at line 541 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ sigRead

bool XrdXrootdProtocol::sigRead
protected

Definition at line 543 of file XrdXrootdProtocol.hh.

Referenced by ProcSig().

◆ sigReq

SecurityRequest XrdXrootdProtocol::sigReq
protected

Definition at line 539 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and ProcSig().

◆ sigReq2Ver

ClientRequest XrdXrootdProtocol::sigReq2Ver
protected

Definition at line 538 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ sigWarn

bool XrdXrootdProtocol::sigWarn
protected

Definition at line 544 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ srvrAioOps

RAtomic_int XrdXrootdProtocol::srvrAioOps = {0}
staticprotected

Definition at line 549 of file XrdXrootdProtocol.hh.

Referenced by aioUpdate().

◆ Status

char XrdXrootdProtocol::Status
protected

Definition at line 524 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and Recycle().

◆ Stream

XrdXrootdProtocol* XrdXrootdProtocol::Stream[maxStreams]
protected

Definition at line 607 of file XrdXrootdProtocol.hh.

Referenced by VerifyStream().

◆ streamMutex

XrdSysMutex XrdXrootdProtocol::streamMutex
protected

Definition at line 603 of file XrdXrootdProtocol.hh.

Referenced by Recycle(), StreamNOP(), and VerifyStream().

◆ tlsCap

char XrdXrootdProtocol::tlsCap = 0
staticprotected

Definition at line 481 of file XrdXrootdProtocol.hh.

◆ tlsCtx

XrdTlsContext * XrdXrootdProtocol::tlsCtx = 0
staticprotected

Definition at line 402 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ tlsNot

char XrdXrootdProtocol::tlsNot = 0
staticprotected

Definition at line 482 of file XrdXrootdProtocol.hh.

◆ tlsPort

int XrdXrootdProtocol::tlsPort = 0
staticprotected

Definition at line 434 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ totReadP

long long XrdXrootdProtocol::totReadP
protected

Definition at line 510 of file XrdXrootdProtocol.hh.

◆ TraceID

const char * XrdXrootdProtocol::TraceID = "Protocol"
staticprotected

Definition at line 410 of file XrdXrootdProtocol.hh.

◆ unbindMutex

XrdSysMutex XrdXrootdProtocol::unbindMutex
protected

Definition at line 602 of file XrdXrootdProtocol.hh.

Referenced by Recycle(), and RequestClose().

◆ usxMaxNsz

int XrdXrootdProtocol::usxMaxNsz = kXR_faMaxNlen
staticprotected

Definition at line 469 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ usxMaxVsz

int XrdXrootdProtocol::usxMaxVsz = kXR_faMaxVlen
staticprotected

Definition at line 470 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ usxParms

char * XrdXrootdProtocol::usxParms = 0
staticprotected

Definition at line 471 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Window

int XrdXrootdProtocol::Window
staticprotected

Definition at line 433 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ wvInfo

XrdXrootdWVInfo* XrdXrootdProtocol::wvInfo
protected

Definition at line 587 of file XrdXrootdProtocol.hh.

◆ wvSeq

unsigned char XrdXrootdProtocol::wvSeq
protected

Definition at line 621 of file XrdXrootdProtocol.hh.

◆ XPList

XrdXrootdXPath XrdXrootdProtocol::XPList
staticprotected

Definition at line 397 of file XrdXrootdProtocol.hh.

Referenced by Configure().


The documentation for this class was generated from the following files: