XRootD
XrdXrootdProtocol Class Reference

#include <XrdXrootdProtocol.hh>

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

Classes

struct  GetDataCtl
 
union  GetDataCtl.__unnamed189__
 
union  GetDataCtl.__unnamed191__
 
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 158 of file XrdXrootdProtocol.hh.


Class Documentation

◆ XrdXrootdProtocol::GetDataCtl.__unnamed189__

union XrdXrootdProtocol::GetDataCtl.__unnamed189__

Definition at line 563 of file XrdXrootdProtocol.hh.

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

◆ XrdXrootdProtocol::GetDataCtl.__unnamed191__

union XrdXrootdProtocol::GetDataCtl.__unnamed191__

Definition at line 571 of file XrdXrootdProtocol.hh.

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

◆ XrdXrootdProtocol::RC_Table

struct XrdXrootdProtocol::RC_Table

Definition at line 455 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 451 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 216 of file XrdXrootdProtocol.hh.

216 {Cleanup();}

Member Function Documentation

◆ aioUpdate()

void XrdXrootdProtocol::aioUpdate ( int  val)
inline

Definition at line 164 of file XrdXrootdProtocol.hh.

164 {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 166 of file XrdXrootdProtocol.hh.

166 {linkAioReq += val;}

References linkAioReq.

◆ Buffer()

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

Definition at line 894 of file XrdXrootdProtocol.cc.

895 {
896  XrdBuffer *xbP = (XrdBuffer *)h;
897 
898  if (h)
899  {if (bsz) *bsz = xbP->bsize;
900  return xbP->buff;
901  }
902  if (bsz) *bsz = 0;
903  return 0;
904 }
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 910 of file XrdXrootdProtocol.cc.

912 {
913 
914 // Qualify swap choice
915 //
916  if (minasz >= argp->bsize || datasz >= argp->bsize/2) return Swap(buff);
917  errno = 0;
918  return 0;
919 }
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 1540 of file XrdXrootdProtocol.cc.

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

References RequestClose().

+ Here is the call graph for this function:

◆ Configure()

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

Definition at line 175 of file XrdXrootdConfig.cc.

176 {
177 /*
178  Function: Establish configuration at load time.
179 
180  Input: None.
181 
182  Output: 0 upon success or !0 otherwise.
183 */
184 
186  (XrdSfsFileSystem *nativeFS,
188  const char *configFn,
189  const char *theParms);
190 
191  XrdOucEnv xrootdEnv;
192  XrdXrootdXPath *xp;
193  char *adminp, *rdf, *bP, *tmp, buff[1024];
194  int i, n;
195 
196 // Copy out the special info we want to use at top level
197 //
198  eDest.logger(pi->eDest->logger());
200  SI = new XrdXrootdStats(pi->Stats);
201  XrdXrootd::SI= SI;
202  Sched = pi->Sched; XrdXrootd::Sched = pi->Sched;
203  BPool = pi->BPool; XrdXrootd::BPool = pi->BPool;
204  hailWait = pi->hailWait;
205  readWait = pi->readWait;
206  Port = pi->Port;
207  myInst = pi->myInst;
208  Window = pi->WSize;
209  tlsPort = pi->tlsPort;
210  tlsCtx = pi->tlsCtx;
211  XrdXrootdCF = pi->totalCF;
212 
213 // Record globally accessible values
214 //
216  XrdXrootdPort = pi->Port;
217 
218 // Set the callback object static areas now!
219 //
221 
222 // Pick up exported paths from the command line
223 //
224  for (i = 1; i < pi->argc; i++) xexpdo(pi->argv[i]);
225 
226 // Pre-initialize some i/o values. Note that we now set maximum readv element
227 // transfer size to the buffer size (before it was a reasonable 256K).
228 //
229  n = (pi->theEnv ? pi->theEnv->GetInt("MaxBuffSize") : 0);
230  maxTransz = maxBuffsz = (n ? n : BPool->MaxSize());
231  maxReadv_ior = maxTransz-(int)sizeof(readahead_list);
232 
233 // Export the readv_ior_max and readv_iov_max values
234 //
235  {char buff[256];
236  snprintf(buff, sizeof(buff), "%d,%d", maxReadv_ior, XrdProto::maxRvecsz);
237  XrdOucEnv::Export("XRD_READV_LIMITS", buff);
238  }
239 
240  memset(Route, 0, sizeof(Route));
241 
242 // Now process and configuration parameters
243 //
244  rdf = (parms && *parms ? parms : pi->ConfigFN);
245  if (rdf && Config(rdf)) return 0;
247 
248 // Initialize the packet marking framework if configured. We do that here as
249 // nothing else following this code can fail but we can so be consistent.
250 //
251  bool bad = false;
253  if (PMark)
254  {if (pi->theEnv) pi->theEnv->PutPtr("XrdNetPMark*", PMark);
255  xrootdEnv.PutPtr("XrdNetPMark*", PMark);
256  }
257  else if (bad) return 0;
258 
259 // Check if we are exporting a generic object name
260 //
261  if (XPList.Opts() & XROOTDXP_NOSLASH)
262  {eDest.Say("Config exporting ", XPList.Path(n)); n += 2;}
263  else n = 0;
264 
265 // Check if we are exporting anything
266 //
267  if (!(xp = XPList.Next()) && !n)
268  {XPList.Insert("/tmp"); n = 8;
269  eDest.Say("Config warning: only '/tmp' will be exported.");
270  } else {
271  while(xp) {eDest.Say("Config exporting ", xp->Path(i));
272  n += i+2; xp = xp->Next();
273  }
274  }
275 
276 // Export the exports
277 //
278  bP = tmp = (char *)malloc(n);
279  if (XPList.Opts() & XROOTDXP_NOSLASH)
280  {strcpy(bP, XPList.Path(i)); bP += i, *bP++ = ' ';}
281  xp = XPList.Next();
282  while(xp) {strcpy(bP, xp->Path(i)); bP += i; *bP++ = ' '; xp = xp->Next();}
283  *(bP-1) = '\0';
284  XrdOucEnv::Export("XRDEXPORTS", tmp); free(tmp);
285 
286 // Initialize the security system if this is wanted
287 //
288  if (!ConfigSecurity(xrootdEnv, pi->ConfigFN)) return 0;
289 
290 // Set up the network for self-identification and display it
291 //
292  pi->NetTCP->netIF.Port(Port);
293  pi->NetTCP->netIF.Display("Config ");
294 
295 // Establish our specific environment that will be passed along
296 //
297  xrootdEnv.PutPtr("XrdInet*", (void *)(pi->NetTCP));
298  xrootdEnv.PutPtr("XrdNetIF*", (void *)(&(pi->NetTCP->netIF)));
299  xrootdEnv.PutPtr("XrdScheduler*", Sched);
300 
301 // Copy over the xrd environment which contains plugin argv's and re-export
302 // the monitoring registration object into out own env for simplicity
303 //
304  if (pi->theEnv)
305  {xrootdEnv.PutPtr("xrdEnv*", pi->theEnv);
306  void* theMon = pi->theEnv->GetPtr("XrdMonRoll*");
307  if (theMon) xrootdEnv.PutPtr("XrdMonRoll*", theMon);
308  }
309 
310 // Initialize monitoring (it won't do anything if it wasn't enabled). This
311 // needs to be done before we load any plugins as plugins may need monitoring.
312 //
313  if (!ConfigMon(pi, xrootdEnv)) return 0;
314 
315 // Get the filesystem to be used and its features.
316 //
317  if (!ConfigFS(xrootdEnv, pi->ConfigFN)) return 0;
318  fsFeatures = osFS->Features();
320  if (pi->theEnv) pi->theEnv->PutPtr("XrdSfsFileSystem*", osFS);
321 
322 // Check if the file system includes a custom prepare handler as this will
323 // affect how we handle prepare requests.
324 //
325  if (fsFeatures & XrdSfs::hasPRP2 || xrootdEnv.Get("XRD_PrepHandler"))
326  PrepareAlt = true;
327 
328 // Check if the diglib should be loaded. We only support the builtin one. In
329 // the future we will have to change this code to be like the above.
330 //
331  if (digParm)
332  {TRACE(DEBUG, "Loading dig filesystem builtin");
333  digFS = XrdDigGetFS(osFS, eDest.logger(), pi->ConfigFN, digParm);
334  if (!digFS) eDest.Emsg("Config","Unable to load digFS; "
335  "remote debugging disabled!");
336  }
337 
338 // Check if we are going to be processing checksums locally
339 //
340  if (JobCKT) {
341  XrdOucString csList(1024);
342  XrdOucErrInfo myError("Config");
343  XrdOucTList *tP = JobCKTLST;
344  int csNum = 0;
345  do {
346  if(JobLCL) {
347  // Check natively supported checksum
348  if (osFS->chksum(XrdSfsFileSystem::csSize, tP->text, 0, myError)) {
349  eDest.Emsg("Config", tP->text, "checksum is not natively supported.");
350  return 0;
351  }
352  }
353  tP->ival[1] = myError.getErrInfo();
354  if (csNum) csList += ',';
355  csList.append(csNum);
356  csList.append(':');
357  csList.append(tP->text);
358  csNum++;
359  tP = tP->next;
360  } while (tP);
361  if (csNum) XrdOucEnv::Export("XRD_CSLIST", csList.c_str());
362  }
363 
364 // Configure the redirect plugins
365 //
366  if (!RDLPath.empty())
367  {for (int i = 0; i < (int)RDLPath.size(); i++)
368  {const char* parm = (RDLParm[i].length() ? RDLParm[i].c_str() : 0);
369  if (!ConfigRedirPI(RDLPath[i].c_str(),xrootdEnv,pi->ConfigFN,parm))
370  return 0;
371  }
372  }
373 
374 // Initialiaze for AIO. If we are not in debug mode and aio is enabled then we
375 // turn off async I/O if tghe filesystem requests it or if this is a caching
376 // proxy and we were asked not to use aio in such a cacse.
377 //
378  if (!(asyncFlags & asDebug) && as_aioOK)
379  {if (fsFeatures & XrdSfs::hasNAIO) as_aioOK = false;
380  else if (asyncFlags & asNoCache && fsFeatures & XrdSfs::hasCACH)
381  as_aioOK = false;
382  if (!as_aioOK) eDest.Say("Config asynchronous I/O has been disabled!");
383  }
384 
385 // Compute the maximum stutter allowed during async I/O (one per 64k)
386 //
387  if (as_segsize > 65536) as_okstutter = as_segsize/65536;
388 
389 // Establish final sendfile processing mode. This may be turned off by the
390 // link or by the SFS plugin usually because it's a proxy.
391 //
392  const char *why = 0;
393  if (!as_nosf)
394  {if (fsFeatures & XrdSfs::hasNOSF) why = "file system plugin.";
395  else if (!XrdLink::sfOK) why = "OS kernel.";
396  if (why)
397  {as_nosf = true;
398  eDest.Say("Config sendfile has been disabled by ", why);
399  }
400  }
401 
402 // Create the file lock manager and initialize file handling
403 //
406 
407 // Schedule protocol object cleanup (also advise the transit protocol)
408 //
409  ProtStack.Set(pi->Sched, &XrdXrootdTrace, TRACE_MEM);
410  n = (pi->ConnMax/3 ? pi->ConnMax/3 : 30);
411  ProtStack.Set(n, 60*60);
412  XrdXrootdTransit::Init(pi->Sched, n, 60*60);
413 
414 // Initialize the request ID generation object
415 //
416  PrepID = new XrdOucReqID(pi->urAddr, (int)Port);
417 
418 // Initialize for prepare processing
419 //
421  sprintf(buff, "%%s://%s:%d/&L=%%d&U=%%s", pi->myName, pi->Port);
422  Notify = strdup(buff);
423 
424 // Set the redirect flag if we are a pure redirector
425 //
426  int tlsFlags = myRole & kXR_tlsAny;
428  if ((rdf = getenv("XRDREDIRECT"))
429  && (!strcmp(rdf, "R") || !strcmp(rdf, "M")))
430  {isRedir = *rdf;
432  if (!strcmp(rdf, "M")) myRole |=kXR_attrMeta;
433  }
436  myRole |= tlsFlags;
437 
438 // Turn off client redirects if we are neither a redirector nor a proxy server
439 //
440  if (CL_Redir && !isRedir && !isProxy)
441  {CL_Redir = false;
442  eDest.Say("Config warning: 'redirect client' ignored; "
443  "not a redirector nor a proxy server");
444  }
445 
446 // Check if we are redirecting anything
447 //
448  if ((xp = RPList.Next()))
449  {int k;
450  char buff[2048], puff[1024];
451  do {k = xp->Opts();
452  if (Route[k].Host[0] == Route[k].Host[1]
453  && Route[k].Port[0] == Route[k].Port[1]) *puff = 0;
454  else sprintf(puff, "%%%s:%d", Route[k].Host[1], Route[k].Port[1]);
455  sprintf(buff," to %s:%d%s",Route[k].Host[0],Route[k].Port[0],puff);
456  eDest.Say("Config redirect static ", xp->Path(), buff);
457  xp = xp->Next();
458  } while(xp);
459  }
460 
461  if ((xp = RQList.Next()))
462  {int k;
463  const char *cgi1, *cgi2;
464  char buff[2048], puff[1024], xCgi[RD_Num] = {0};
465  if (isRedir) {cgi1 = "+"; cgi2 = getenv("XRDCMSCLUSTERID");}
466  else {cgi1 = ""; cgi2 = pi->myName;}
467  myCNlen = snprintf(buff, sizeof(buff), "%s%s", cgi1, cgi2);
468  myCName = strdup(buff);
469  do {k = xp->Opts();
470  if (Route[k].Host[0] == Route[k].Host[1]
471  && Route[k].Port[0] == Route[k].Port[1]) *puff = 0;
472  else sprintf(puff, "%%%s:%d", Route[k].Host[1], Route[k].Port[1]);
473  sprintf(buff," to %s:%d%s",Route[k].Host[0],Route[k].Port[0],puff);
474  eDest.Say("Config redirect enoent ", xp->Path(), buff);
475  if (!xCgi[k] && cgi2)
476  {bool isdup = Route[k].Host[0] == Route[k].Host[1]
477  && Route[k].Port[0] == Route[k].Port[1];
478  for (i = 0; i < 2; i++)
479  {n = snprintf(buff,sizeof(buff), "%s?tried=%s%s",
480  Route[k].Host[i], cgi1, cgi2);
481  free(Route[k].Host[i]); Route[k].Host[i] = strdup(buff);
482  Route[k].RDSz[i] = n;
483  if (isdup) {Route[k].Host[1] = Route[k].Host[0];
484  Route[k].RDSz[1] = n; break;
485  }
486  }
487  }
488  xCgi[k] = 1;
489  xp = xp->Next();
490  } while(xp);
491  }
492 
493 // Add all jobs that we can run to the admin object
494 //
495  if (JobCKS) XrdXrootdAdmin::addJob("chksum", JobCKS);
496 
497 // Establish the path to be used for admin functions. We will loose this
498 // storage upon an error but we don't care because we'll just exit.
499 //
500  adminp = XrdOucUtils::genPath(pi->AdmPath, 0, ".xrootd");
501 
502 // Setup the admin path (used in all roles).
503 //
504  if (!(AdminSock = XrdNetSocket::Create(&eDest, adminp, "admin", pi->AdmMode))
505  || !XrdXrootdAdmin::Init(&eDest, AdminSock)) return 0;
506 
507 // Indicate whether or not we support extended attributes
508 //
509  {XrdOucEnv myEnv;
510  XrdOucErrInfo eInfo("", &myEnv);
511  char buff[128];
512  if (osFS->FAttr(0, eInfo, 0) == SFS_OK)
513  {usxMaxNsz = myEnv.GetInt("usxMaxNsz");
514  if (usxMaxNsz < 0) usxMaxNsz = 0;
515  usxMaxVsz = myEnv.GetInt("usxMaxVsz");
516  if (usxMaxVsz < 0) usxMaxVsz = 0;
517  snprintf(buff, sizeof(buff), "%d %d", usxMaxNsz, usxMaxVsz);
518  usxParms = strdup(buff);
519  } else {
520  usxMaxNsz = 0;
521  usxMaxVsz = 0;
522  usxParms = strdup("0 0");
523  }
524  }
525 
526 // Finally, check if we really need to be in bypass mode if it is set
527 //
528  if (OD_Bypass)
529  {const char *penv = getenv("XRDXROOTD_PROXY");
530  if (!penv || *penv != '=')
531  {OD_Bypass = false;
532  eDest.Say("Config warning: 'fsoverload bypass' ignored; "
533  "not a forwarding proxy.");
534  }
535  }
536 
537 // Add any additional features
538 //
543  myRole |= kXR_anongpf;
544 
545 // Finally note whether or not we have TLS enabled
546 //
547  if (tlsCtx) myRole |= kXR_haveTLS;
548 
549 // Return success
550 //
551  free(adminp);
552  return 1;
553 }
#define kXR_isManager
Definition: XProtocol.hh:1156
#define kXR_suppgrw
Definition: XProtocol.hh:1174
#define kXR_attrMeta
Definition: XProtocol.hh:1159
#define kXR_haveTLS
Definition: XProtocol.hh:1179
#define kXR_anongpf
Definition: XProtocol.hh:1172
#define kXR_tlsAny
Definition: XProtocol.hh:1181
#define kXR_isServer
Definition: XProtocol.hh:1157
#define kXR_attrCache
Definition: XProtocol.hh:1158
#define kXR_attrProxy
Definition: XProtocol.hh:1160
#define kXR_LBalServer
Definition: XProtocol.hh:1151
#define kXR_supposc
Definition: XProtocol.hh:1175
#define kXR_DataServer
Definition: XProtocol.hh:1150
#define kXR_supgpf
Definition: XProtocol.hh:1173
#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:276
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:235
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:170
void * GetPtr(const char *varname)
Definition: XrdOucEnv.cc:263
char * Get(const char *varname)
Definition: XrdOucEnv.hh:69
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:298
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:463
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:95
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:141
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
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 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(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:686
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(), 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, 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 3372 of file XrdXrootdXeq.cc.

3373 {
3374  int rc;
3376  numWrites++;
3377 
3378 // Unmarshall the data
3379 //
3381  n2hll(Request.write.offset, IO.Offset);
3382 
3383 // Find the file object. We will only drain socket data on the control path.
3384 // .
3385  if (!FTab || !(IO.File = FTab->Get(fh.handle)))
3386  {IO.IOLen -= myBlast;
3387  IO.File = 0;
3388  return do_WriteNone(Request.write.pathid);
3389  }
3390 
3391 // If we are monitoring, insert a write entry
3392 //
3393  if (Monitor.InOut())
3395  Request.write.offset);
3396  IO.File->Stats.wrOps(IO.IOLen); // Optimistically correct
3397 
3398 // Trace this entry
3399 //
3400  TRACEP(FSIO, "fh=" <<fh.handle <<" write " <<IO.IOLen <<'@' <<IO.Offset);
3401 
3402 // Write data that was already read
3403 //
3404  if ((rc = IO.File->XrdSfsp->write(IO.Offset, myBuff, myBlast)) < 0)
3405  {IO.IOLen = IO.IOLen-myBlast; IO.EInfo[0] = rc; IO.EInfo[1] = 0;
3406  return do_WriteNone();
3407  }
3408  IO.Offset += myBlast; IO.IOLen -= myBlast;
3409 
3410 // See if we need to finish this request in the normal way
3411 //
3412  if (IO.IOLen > 0) return do_WriteAll();
3413  return Response.Send();
3414 }
kXR_char fhandle[4]
Definition: XProtocol.hh:807
struct ClientRequestHdr header
Definition: XProtocol.hh:846
kXR_int64 offset
Definition: XProtocol.hh:808
struct ClientWriteRequest write
Definition: XProtocol.hh:876
kXR_int32 dlen
Definition: XProtocol.hh:159
#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 174 of file XrdXrootdProtocol.hh.

174 {(*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 1403 of file XrdXrootdProtocol.cc.

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

186 {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:87
#define kXR_PROTOCOLVERSION
Definition: XProtocol.hh:70
kXR_int32 second
Definition: XProtocol.hh:85
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 4259 of file XrdXrootdXeq.cc.

4260 {
4261  char Buff[4096];
4262  const char *bP = Buff;
4263 
4264  if (Client == &Entity) bP = Entity.moninfo;
4265  else {snprintf(Buff,sizeof(Buff),
4266  "&p=%s&n=%s&h=%s&o=%s&r=%s&g=%s&m=%s%s&I=%c",
4267  Client->prot,
4268  (Client->name ? Client->name : ""),
4269  (Client->host ? Client->host : ""),
4270  (Client->vorg ? Client->vorg : ""),
4271  (Client->role ? Client->role : ""),
4272  (Client->grps ? Client->grps : ""),
4273  (Client->moninfo ? Client->moninfo : ""),
4274  (Entity.moninfo ? Entity.moninfo : ""),
4275  (clientPV & XrdOucEI::uIPv4 ? '4' : '6')
4276  );
4277  Client->secMon = &Monitor;
4278  }
4279 
4280  Monitor.Report(bP);
4281  if (Entity.moninfo) {free(Entity.moninfo); Entity.moninfo = 0;}
4282 }
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:990
@ kXR_ArgTooLong
Definition: XProtocol.hh:992
kXR_char streamid[2]
Definition: XProtocol.hh:156
kXR_unt16 requestid
Definition: XProtocol.hh:157
@ kXR_sigver
Definition: XProtocol.hh:141
@ kXR_write
Definition: XProtocol.hh:131
@ kXR_pgwrite
Definition: XProtocol.hh:138
#define NEED2SECURE(protP)
This class implements the XRootD protocol security protection.
static const char * reqName(kXR_unt16 reqCode)
Definition: XProtocol.cc:151
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  default: break;
509  }
510 
511 // Now select the requests that do not need authentication
512 //
513  switch(Request.header.requestid)
514  {case kXR_protocol: return do_Protocol(); // dlen ignored
515  case kXR_ping: return do_Ping(); // dlen ignored
516  default: break;
517  }
518 
519 // Force authentication at this point, if need be
520 //
521  if (Status & XRD_NEED_AUTH)
522  {int rc;
523  if (Request.header.requestid == kXR_auth) rc = do_Auth();
525  "Invalid request; user not authenticated");
526  rc = -1;
527  }
529  return rc;
530  }
531 
532 // Construct request ID as the following functions are async eligible
533 //
535 
536 // Process items that don't need arguments but may have them
537 //
538  switch(Request.header.requestid)
539  {case kXR_endsess: return do_Endsess();
540  default: break;
541  }
542 
543 // All remaining requests require an argument. Make sure we have one
544 //
545  if (!argp || !Request.header.dlen)
546  {Response.Send(kXR_ArgMissing, "Required argument not present");
547  return 0;
548  }
549 
550 // All of the subsequent requests can be redirected and are subject to
551 // prefunctory redirection which we check here.
552 //
553  if (CL_Redir && !Link->hasBridge())
554  {bool doRdr = false;
555  if (Link->AddrInfo()->isPrivate()) rdType = 1;
556  if (RouteClient.pvtIP && rdType) doRdr = true;
558  doRdr = true;
559  else if (RouteClient.DomCnt)
560  {XrdOucString hName = Link->Host();
561  for (int i = 0; i < RouteClient.DomCnt; i++)
562  {if (hName.endswith(RouteClient.Domain[i]))
563  {doRdr = true; break;}
564  }
565  }
566  if (doRdr)
567  {Response.Send(kXR_redirect,Route[RD_client].Port[rdType],
568  Route[RD_client].Host[rdType]);
569  return -1;
570  }
571  }
572 
573 // Process items that keep own statistics
574 //
575  switch(Request.header.requestid)
576  {case kXR_open: return do_Open();
577  case kXR_gpfile: return do_gpFile();
578  default: break;
579  }
580 
581 // Update misc stats count
582 //
583  SI->Bump(SI->miscCnt);
584 
585 // Now process whatever we have
586 //
587  switch(Request.header.requestid)
588  {case kXR_chmod: return do_Chmod();
589  case kXR_dirlist: return do_Dirlist();
590  case kXR_fattr: return do_FAttr();
591  case kXR_locate: return do_Locate();
592  case kXR_mkdir: return do_Mkdir();
593  case kXR_mv: return do_Mv();
594  case kXR_query: return do_Query();
595  case kXR_prepare: return do_Prepare();
596  case kXR_rm: return do_Rm();
597  case kXR_rmdir: return do_Rmdir();
598  case kXR_set: return do_Set();
599  case kXR_stat: return do_Stat();
600  case kXR_statx: return do_Statx();
601  case kXR_truncate: return do_Truncate();
602  default: break;
603  }
604 
605 // Whatever we have, it's not valid
606 //
607  Response.Send(kXR_InvalidRequest, "Invalid request code");
608  return 0;
609 }
@ kXR_InvalidRequest
Definition: XProtocol.hh:996
@ kXR_ArgMissing
Definition: XProtocol.hh:991
@ kXR_SigVerErr
Definition: XProtocol.hh:1012
@ kXR_redirect
Definition: XProtocol.hh:904
@ kXR_read
Definition: XProtocol.hh:125
@ kXR_open
Definition: XProtocol.hh:122
@ kXR_writev
Definition: XProtocol.hh:143
@ kXR_readv
Definition: XProtocol.hh:137
@ kXR_mkdir
Definition: XProtocol.hh:120
@ kXR_sync
Definition: XProtocol.hh:128
@ kXR_chmod
Definition: XProtocol.hh:114
@ kXR_bind
Definition: XProtocol.hh:136
@ kXR_dirlist
Definition: XProtocol.hh:116
@ kXR_fattr
Definition: XProtocol.hh:132
@ kXR_rm
Definition: XProtocol.hh:126
@ kXR_query
Definition: XProtocol.hh:113
@ kXR_gpfile
Definition: XProtocol.hh:117
@ kXR_login
Definition: XProtocol.hh:119
@ kXR_auth
Definition: XProtocol.hh:112
@ kXR_endsess
Definition: XProtocol.hh:135
@ kXR_set
Definition: XProtocol.hh:130
@ kXR_rmdir
Definition: XProtocol.hh:127
@ kXR_statx
Definition: XProtocol.hh:134
@ kXR_truncate
Definition: XProtocol.hh:140
@ kXR_protocol
Definition: XProtocol.hh:118
@ kXR_mv
Definition: XProtocol.hh:121
@ kXR_ping
Definition: XProtocol.hh:123
@ kXR_stat
Definition: XProtocol.hh:129
@ kXR_pgread
Definition: XProtocol.hh:142
@ kXR_chkpoint
Definition: XProtocol.hh:124
@ kXR_locate
Definition: XProtocol.hh:139
@ kXR_close
Definition: XProtocol.hh:115
@ kXR_prepare
Definition: XProtocol.hh:133
#define XRD_NEED_AUTH
static bool InDomain(XrdNetAddrInfo *epaddr)
Definition: XrdNetIF.cc:606
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_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 615 of file XrdXrootdProtocol.cc.

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

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 925 of file XrdXrootdProtocol.cc.

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

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 660 of file XrdXrootdProtocol.cc.

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

1551 {
1553  if (CloseRequested) return false;
1554  CloseRequested = true;
1555  return true;
1556 }

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 3649 of file XrdXrootdXeq.cc.

3650 {
3651 
3652 // Make sure we have some data to send
3653 //
3654  if (!IO.IOLen) return 1;
3655 
3656 // Send off the data
3657 //
3658  IO.IOLen = Response.Send(fildes, IO.Offset, IO.IOLen);
3659  return IO.IOLen;
3660 }

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 3664 of file XrdXrootdXeq.cc.

3665 {
3666  int i, xframt = 0;
3667 
3668 // Make sure we have some data to send
3669 //
3670  if (!IO.IOLen) return 1;
3671 
3672 // Verify the length, it can't be greater than what the client wants
3673 //
3674  for (i = 1; i < sfvnum; i++) xframt += sfvec[i].sendsz;
3675  if (xframt > IO.IOLen) return 1;
3676 
3677 // Send off the data
3678 //
3679  if (xframt) IO.IOLen = Response.Send(sfvec, sfvnum, xframt);
3680  else {IO.IOLen = 0; Response.Send();}
3681  return IO.IOLen;
3682 }

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 3688 of file XrdXrootdXeq.cc.

3689 {
3690  if (fildes < 0) IO.File->sfEnabled = 0;
3691  else IO.File->fdNum = fildes;
3692 }

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

◆ SetSF()

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

Definition at line 4328 of file XrdXrootdXeq.cc.

4329 {
4330  XrdXrootdFHandle fh(fhandle);
4331  XrdXrootdFile *theFile;
4332 
4333  if (!FTab || !(theFile = FTab->Get(fh.handle))) return -EBADF;
4334 
4335 // Turn it off or on if so wanted
4336 //
4337  if (!seton) theFile->sfEnabled = 0;
4338  else if (theFile->fdNum >= 0) theFile->sfEnabled = 1;
4339 
4340 // All done
4341 //
4342  return 0;
4343 }

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 856 of file XrdXrootdProtocol.cc.

857 {
858 // Synchronize statistics if need be
859 //
860  if (do_sync)
861  {SI->statsMutex.Lock();
862  SI->readCnt += numReads;
863  cumReads += numReads; numReads = 0;
864  SI->prerCnt += numReadP;
865  cumReadP += numReadP; numReadP = 0;
866 
867  SI->rvecCnt += numReadV;
868  cumReadV += numReadV; numReadV = 0;
869  SI->rsegCnt += numSegsV;
870  cumSegsV += numSegsV; numSegsV = 0;
871 
872  SI->wvecCnt += numWritV;
873  cumWritV += numWritV; numWritV = 0;
874  SI->wsegCnt += numSegsW;
875  cumSegsW += numSegsW, numSegsW = 0;
876 
877  SI->writeCnt += numWrites;
879  SI->statsMutex.UnLock();
880  }
881 
882 // Now return the statistics
883 //
884  return SI->Stats(buff, blen, do_sync);
885 }
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 935 of file XrdXrootdProtocol.cc.

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

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 951 of file XrdXrootdProtocol.cc.

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

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 976 of file XrdXrootdProtocol.cc.

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

Member Data Documentation

◆ ableTLS

bool XrdXrootdProtocol::ableTLS
protected

Definition at line 625 of file XrdXrootdProtocol.hh.

◆ AdminSock

XrdNetSocket * XrdXrootdProtocol::AdminSock = 0
staticprotected

Definition at line 427 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ AppName

char* XrdXrootdProtocol::AppName
protected

Definition at line 535 of file XrdXrootdProtocol.hh.

◆ argp

XrdBuffer* XrdXrootdProtocol::argp
protected

Definition at line 516 of file XrdXrootdProtocol.hh.

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

◆ as_aioOK

bool XrdXrootdProtocol::as_aioOK = true
static

Definition at line 233 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ as_force

bool XrdXrootdProtocol::as_force = false
static

Definition at line 232 of file XrdXrootdProtocol.hh.

◆ as_maxperlnk

int XrdXrootdProtocol::as_maxperlnk = 8
static

Definition at line 222 of file XrdXrootdProtocol.hh.

◆ as_maxperreq

int XrdXrootdProtocol::as_maxperreq = 8
static

Definition at line 223 of file XrdXrootdProtocol.hh.

◆ as_maxpersrv

int XrdXrootdProtocol::as_maxpersrv = 4096
static

Definition at line 224 of file XrdXrootdProtocol.hh.

◆ as_maxstalls

int XrdXrootdProtocol::as_maxstalls = 4
static

Definition at line 229 of file XrdXrootdProtocol.hh.

◆ as_miniosz

int XrdXrootdProtocol::as_miniosz = 98304
static

Definition at line 225 of file XrdXrootdProtocol.hh.

◆ as_minsfsz

int XrdXrootdProtocol::as_minsfsz = 8192
static

Definition at line 226 of file XrdXrootdProtocol.hh.

◆ as_nosf

bool XrdXrootdProtocol::as_nosf = false
static

Definition at line 234 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ as_okstutter

short XrdXrootdProtocol::as_okstutter = 1
static

Definition at line 230 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ as_seghalf

int XrdXrootdProtocol::as_seghalf = 32768
static

Definition at line 227 of file XrdXrootdProtocol.hh.

◆ as_segsize

int XrdXrootdProtocol::as_segsize = 65536
static

Definition at line 228 of file XrdXrootdProtocol.hh.

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

◆ as_syncw

bool XrdXrootdProtocol::as_syncw = false
static

Definition at line 235 of file XrdXrootdProtocol.hh.

◆ as_timeout

short XrdXrootdProtocol::as_timeout = 45
static

Definition at line 231 of file XrdXrootdProtocol.hh.

◆ AuthProt

XrdSecProtocol* XrdXrootdProtocol::AuthProt
protected

Definition at line 532 of file XrdXrootdProtocol.hh.

◆ boundRecycle

XrdSysSemaphore* XrdXrootdProtocol::boundRecycle
protected

Definition at line 606 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ BPool

XrdBuffManager * XrdXrootdProtocol::BPool
staticprotected

Definition at line 406 of file XrdXrootdProtocol.hh.

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

◆ CapVer

unsigned char XrdXrootdProtocol::CapVer
protected

Definition at line 526 of file XrdXrootdProtocol.hh.

◆ CIA

XrdSecService * XrdXrootdProtocol::CIA = 0
staticprotected

Definition at line 401 of file XrdXrootdProtocol.hh.

◆ CL_Redir

bool XrdXrootdProtocol::CL_Redir = false
staticprotected

Definition at line 464 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ Client

XrdSecEntity* XrdXrootdProtocol::Client
protected

Definition at line 531 of file XrdXrootdProtocol.hh.

Referenced by MonAuth().

◆ clientPV

int XrdXrootdProtocol::clientPV
protected

Definition at line 520 of file XrdXrootdProtocol.hh.

Referenced by MonAuth().

◆ clientRN

int XrdXrootdProtocol::clientRN
protected

Definition at line 521 of file XrdXrootdProtocol.hh.

◆ CloseRequested

bool XrdXrootdProtocol::CloseRequested
protected

Definition at line 527 of file XrdXrootdProtocol.hh.

Referenced by RequestClose().

◆ cumReadP

int XrdXrootdProtocol::cumReadP
protected

Definition at line 504 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumReads

int XrdXrootdProtocol::cumReads
protected

Definition at line 503 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumReadV

int XrdXrootdProtocol::cumReadV
protected

Definition at line 505 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumSegsV

int XrdXrootdProtocol::cumSegsV
protected

Definition at line 506 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumSegsW

int XrdXrootdProtocol::cumSegsW
protected

Definition at line 508 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumWrites

int XrdXrootdProtocol::cumWrites
protected

Definition at line 509 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumWritV

int XrdXrootdProtocol::cumWritV
protected

Definition at line 507 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ DHS

XrdSecProtector * XrdXrootdProtocol::DHS = 0
staticprotected

Definition at line 402 of file XrdXrootdProtocol.hh.

◆ digFS

XrdSfsFileSystem * XrdXrootdProtocol::digFS = 0
staticprotected

Definition at line 400 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ doTLS

char XrdXrootdProtocol::doTLS
protected

Definition at line 624 of file XrdXrootdProtocol.hh.

◆ eDest

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

Definition at line 407 of file XrdXrootdProtocol.hh.

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

◆ endNote

XrdSysCondVar2* XrdXrootdProtocol::endNote
protected

Definition at line 607 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ Entity

XrdSecEntity XrdXrootdProtocol::Entity
protected

Definition at line 533 of file XrdXrootdProtocol.hh.

Referenced by Match(), and MonAuth().

◆ fsFeatures

uint64_t XrdXrootdProtocol::fsFeatures = 0
staticprotected

Definition at line 447 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ FTab

XrdXrootdFileTable* XrdXrootdProtocol::FTab
protected

Definition at line 517 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 431 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Match().

◆ halfBSize

int XrdXrootdProtocol::halfBSize
protected

Definition at line 599 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ hcMax

int XrdXrootdProtocol::hcMax = 28657
staticprotected

Definition at line 595 of file XrdXrootdProtocol.hh.

◆ hcNext

int XrdXrootdProtocol::hcNext
protected

Definition at line 597 of file XrdXrootdProtocol.hh.

◆ hcNow

int XrdXrootdProtocol::hcNow
protected

Definition at line 598 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ hcPrev

int XrdXrootdProtocol::hcPrev
protected

Definition at line 596 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ IO

XrdXrootd::IOParms XrdXrootdProtocol::IO
protected

Definition at line 591 of file XrdXrootdProtocol.hh.

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

◆ isActive

bool XrdXrootdProtocol::isActive
protected

Definition at line 610 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ isLinkWT

bool XrdXrootdProtocol::isLinkWT
protected

Definition at line 611 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ isNOP

bool XrdXrootdProtocol::isNOP
protected

Definition at line 612 of file XrdXrootdProtocol.hh.

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

◆ isProxy

bool XrdXrootdProtocol::isProxy = false
staticprotected

Definition at line 466 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ isRedir

char XrdXrootdProtocol::isRedir = 0
staticprotected

Definition at line 440 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Match().

◆ isTLS

bool XrdXrootdProtocol::isTLS
protected

Definition at line 626 of file XrdXrootdProtocol.hh.

◆ JobCKCGI

char XrdXrootdProtocol::JobCKCGI =0
staticprotected

Definition at line 442 of file XrdXrootdProtocol.hh.

◆ JobCKS

XrdXrootdJob * XrdXrootdProtocol::JobCKS = 0
staticprotected

Definition at line 443 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobCKT

char * XrdXrootdProtocol::JobCKT = 0
staticprotected

Definition at line 444 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobCKTLST

XrdOucTList * XrdXrootdProtocol::JobCKTLST = 0
staticprotected

Definition at line 445 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobLCL

char XrdXrootdProtocol::JobLCL = 0
staticprotected

Definition at line 441 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ keepT

time_t XrdXrootdProtocol::keepT = 86400
staticprotected

Definition at line 423 of file XrdXrootdProtocol.hh.

◆ LimitError

bool XrdXrootdProtocol::LimitError = true
staticprotected

Definition at line 631 of file XrdXrootdProtocol.hh.

◆ Link

◆ linkAioReq

RAtomic_int XrdXrootdProtocol::linkAioReq
protected

Definition at line 549 of file XrdXrootdProtocol.hh.

Referenced by aioUpdReq().

◆ Locker

XrdXrootdFileLock * XrdXrootdProtocol::Locker
staticprotected

Definition at line 404 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxBuffsz

int XrdXrootdProtocol::maxBuffsz
staticprotected

Definition at line 487 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxPio

const int XrdXrootdProtocol::maxPio = 4
staticprotected

Definition at line 614 of file XrdXrootdProtocol.hh.

◆ maxReadv_ior

int XrdXrootdProtocol::maxReadv_ior
staticprotected
Initial value:

Definition at line 489 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxStreams

const int XrdXrootdProtocol::maxStreams = 16
static

Definition at line 218 of file XrdXrootdProtocol.hh.

Referenced by VerifyStream().

◆ maxTransz

int XrdXrootdProtocol::maxTransz = 262144
staticprotected

Definition at line 488 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Monitor

XrdXrootdMonitor::User XrdXrootdProtocol::Monitor
protected

Definition at line 518 of file XrdXrootdProtocol.hh.

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

◆ myBlast

int XrdXrootdProtocol::myBlast
protected

Definition at line 557 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan().

◆ myBlen

int XrdXrootdProtocol::myBlen
protected

Definition at line 556 of file XrdXrootdProtocol.hh.

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

◆ myBuff

char* XrdXrootdProtocol::myBuff
protected

Definition at line 555 of file XrdXrootdProtocol.hh.

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

◆ myCName

const char * XrdXrootdProtocol::myCName = 0
staticprotected

Definition at line 438 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myCNlen

int XrdXrootdProtocol::myCNlen = 0
staticprotected

Definition at line 439 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myGID

gid_t XrdXrootdProtocol::myGID = 0
staticprotected

Definition at line 417 of file XrdXrootdProtocol.hh.

◆ myGName

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

Definition at line 421 of file XrdXrootdProtocol.hh.

◆ myGNLen

int XrdXrootdProtocol::myGNLen = 1
staticprotected

Definition at line 419 of file XrdXrootdProtocol.hh.

◆ myInst

const char * XrdXrootdProtocol::myInst = 0
staticprotected

Definition at line 410 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myPID

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

Definition at line 413 of file XrdXrootdProtocol.hh.

◆ myRole

int XrdXrootdProtocol::myRole = 0
staticprotected

Definition at line 414 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myRolf

int XrdXrootdProtocol::myRolf = 0
staticprotected

Definition at line 415 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ mySID

unsigned int XrdXrootdProtocol::mySID
protected

Definition at line 609 of file XrdXrootdProtocol.hh.

◆ myStalls

int XrdXrootdProtocol::myStalls
protected

Definition at line 510 of file XrdXrootdProtocol.hh.

◆ myUID

uid_t XrdXrootdProtocol::myUID = 0
staticprotected

Definition at line 418 of file XrdXrootdProtocol.hh.

◆ myUName

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

Definition at line 422 of file XrdXrootdProtocol.hh.

◆ myUNLen

int XrdXrootdProtocol::myUNLen = 1
staticprotected

Definition at line 420 of file XrdXrootdProtocol.hh.

◆ newPio

bool XrdXrootdProtocol::newPio
protected

Definition at line 620 of file XrdXrootdProtocol.hh.

◆ Notify

char * XrdXrootdProtocol::Notify = 0
staticprotected

Definition at line 437 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ numFiles

int XrdXrootdProtocol::numFiles
protected

Definition at line 501 of file XrdXrootdProtocol.hh.

◆ numReadP

int XrdXrootdProtocol::numReadP
protected

Definition at line 495 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numReads

int XrdXrootdProtocol::numReads
protected

Definition at line 494 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numReadV

int XrdXrootdProtocol::numReadV
protected

Definition at line 496 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numSegsV

int XrdXrootdProtocol::numSegsV
protected

Definition at line 497 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numSegsW

int XrdXrootdProtocol::numSegsW
protected

Definition at line 499 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numWrites

int XrdXrootdProtocol::numWrites
protected

Definition at line 500 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), and Stats().

◆ numWritV

int XrdXrootdProtocol::numWritV
protected

Definition at line 498 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ OD_Bypass

bool XrdXrootdProtocol::OD_Bypass = false
staticprotected

Definition at line 461 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ OD_Redir

bool XrdXrootdProtocol::OD_Redir = false
staticprotected

Definition at line 462 of file XrdXrootdProtocol.hh.

◆ OD_Stall

int XrdXrootdProtocol::OD_Stall = 33
staticprotected

Definition at line 460 of file XrdXrootdProtocol.hh.

◆ osFS

XrdSfsFileSystem * XrdXrootdProtocol::osFS
staticprotected

Definition at line 399 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ PathID

short XrdXrootdProtocol::PathID
protected

Definition at line 619 of file XrdXrootdProtocol.hh.

Referenced by getPathID(), and StreamNOP().

◆ pgwCtl

XrdXrootdPgwCtl* XrdXrootdProtocol::pgwCtl
protected

Definition at line 554 of file XrdXrootdProtocol.hh.

◆ pioFirst

XrdXrootdPio* XrdXrootdProtocol::pioFirst
protected

Definition at line 615 of file XrdXrootdProtocol.hh.

◆ pioFree

XrdXrootdPio* XrdXrootdProtocol::pioFree
protected

Definition at line 617 of file XrdXrootdProtocol.hh.

◆ pioLast

XrdXrootdPio* XrdXrootdProtocol::pioLast
protected

Definition at line 616 of file XrdXrootdProtocol.hh.

◆ PMark

XrdNetPMark * XrdXrootdProtocol::PMark = 0
staticprotected

Definition at line 408 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ pmDone

bool XrdXrootdProtocol::pmDone
protected

Definition at line 522 of file XrdXrootdProtocol.hh.

◆ pmHandle

XrdNetPMark::Handle* XrdXrootdProtocol::pmHandle
protected

Definition at line 519 of file XrdXrootdProtocol.hh.

◆ Port

int XrdXrootdProtocol::Port
staticprotected

Definition at line 433 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ PrepareAlt

bool XrdXrootdProtocol::PrepareAlt = false
staticprotected

Definition at line 630 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ PrepareCount

int XrdXrootdProtocol::PrepareCount
protected

Definition at line 633 of file XrdXrootdProtocol.hh.

◆ PrepareLimit

int XrdXrootdProtocol::PrepareLimit = -1
staticprotected

Definition at line 634 of file XrdXrootdProtocol.hh.

◆ PrepID

XrdOucReqID * XrdXrootdProtocol::PrepID = 0
staticprotected

Definition at line 446 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Protect

XrdSecProtect* XrdXrootdProtocol::Protect
protected

Definition at line 534 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ rdType

short XrdXrootdProtocol::rdType
protected

Definition at line 524 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ readWait

int XrdXrootdProtocol::readWait
staticprotected

Definition at line 432 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ redirIPHold

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

Definition at line 436 of file XrdXrootdProtocol.hh.

◆ RedirPI

XrdXrootdRedirPI * XrdXrootdProtocol::RedirPI = 0
staticprotected

Definition at line 409 of file XrdXrootdProtocol.hh.

◆ Req_TLSData

const char XrdXrootdProtocol::Req_TLSData = 0x01
staticprotected

Definition at line 476 of file XrdXrootdProtocol.hh.

◆ Req_TLSGPFile

const char XrdXrootdProtocol::Req_TLSGPFile = 0x02
staticprotected

Definition at line 477 of file XrdXrootdProtocol.hh.

◆ Req_TLSLogin

const char XrdXrootdProtocol::Req_TLSLogin = 0x04
staticprotected

Definition at line 478 of file XrdXrootdProtocol.hh.

◆ Req_TLSSess

const char XrdXrootdProtocol::Req_TLSSess = 0x08
staticprotected

Definition at line 479 of file XrdXrootdProtocol.hh.

◆ Req_TLSTPC

const char XrdXrootdProtocol::Req_TLSTPC = 0x10
staticprotected

Definition at line 480 of file XrdXrootdProtocol.hh.

◆ ReqID

XrdXrootdReqID XrdXrootdProtocol::ReqID
protected

Definition at line 638 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ Request

ClientRequest XrdXrootdProtocol::Request
protected

◆ reserved

char XrdXrootdProtocol::reserved[3]
protected

Definition at line 523 of file XrdXrootdProtocol.hh.

◆ Response

XrdXrootdResponse XrdXrootdProtocol::Response
protected

◆ Resume

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

◆ ResumePio

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

Definition at line 589 of file XrdXrootdProtocol.hh.

◆ reTry

XrdSysSemaphore* XrdXrootdProtocol::reTry
protected

Definition at line 605 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 396 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ RQList

XrdXrootdXPath XrdXrootdProtocol::RQList
staticprotected

Definition at line 397 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ RQLxist

int XrdXrootdProtocol::RQLxist = 0
staticprotected

Definition at line 412 of file XrdXrootdProtocol.hh.

◆ rvSeq

unsigned char XrdXrootdProtocol::rvSeq
protected

Definition at line 621 of file XrdXrootdProtocol.hh.

◆ Sched

XrdScheduler * XrdXrootdProtocol::Sched
staticprotected

Definition at line 405 of file XrdXrootdProtocol.hh.

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

◆ SI

XrdXrootdStats * XrdXrootdProtocol::SI
staticprotected

Definition at line 493 of file XrdXrootdProtocol.hh.

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

◆ sigBuff

char XrdXrootdProtocol::sigBuff[64]
protected

Definition at line 541 of file XrdXrootdProtocol.hh.

Referenced by ProcSig().

◆ sigHere

bool XrdXrootdProtocol::sigHere
protected

Definition at line 543 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and ProcSig().

◆ sigNeed

bool XrdXrootdProtocol::sigNeed
protected

Definition at line 542 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ sigRead

bool XrdXrootdProtocol::sigRead
protected

Definition at line 544 of file XrdXrootdProtocol.hh.

Referenced by ProcSig().

◆ sigReq

SecurityRequest XrdXrootdProtocol::sigReq
protected

Definition at line 540 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and ProcSig().

◆ sigReq2Ver

ClientRequest XrdXrootdProtocol::sigReq2Ver
protected

Definition at line 539 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ sigWarn

bool XrdXrootdProtocol::sigWarn
protected

Definition at line 545 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ srvrAioOps

RAtomic_int XrdXrootdProtocol::srvrAioOps = {0}
staticprotected

Definition at line 550 of file XrdXrootdProtocol.hh.

Referenced by aioUpdate().

◆ Status

char XrdXrootdProtocol::Status
protected

Definition at line 525 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and Recycle().

◆ Stream

XrdXrootdProtocol* XrdXrootdProtocol::Stream[maxStreams]
protected

Definition at line 608 of file XrdXrootdProtocol.hh.

Referenced by VerifyStream().

◆ streamMutex

XrdSysMutex XrdXrootdProtocol::streamMutex
protected

Definition at line 604 of file XrdXrootdProtocol.hh.

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

◆ tlsCap

char XrdXrootdProtocol::tlsCap = 0
staticprotected

Definition at line 482 of file XrdXrootdProtocol.hh.

◆ tlsCtx

XrdTlsContext * XrdXrootdProtocol::tlsCtx = 0
staticprotected

Definition at line 403 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ tlsNot

char XrdXrootdProtocol::tlsNot = 0
staticprotected

Definition at line 483 of file XrdXrootdProtocol.hh.

◆ tlsPort

int XrdXrootdProtocol::tlsPort = 0
staticprotected

Definition at line 435 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ totReadP

long long XrdXrootdProtocol::totReadP
protected

Definition at line 511 of file XrdXrootdProtocol.hh.

◆ TraceID

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

Definition at line 411 of file XrdXrootdProtocol.hh.

◆ unbindMutex

XrdSysMutex XrdXrootdProtocol::unbindMutex
protected

Definition at line 603 of file XrdXrootdProtocol.hh.

Referenced by Recycle(), and RequestClose().

◆ usxMaxNsz

int XrdXrootdProtocol::usxMaxNsz = kXR_faMaxNlen
staticprotected

Definition at line 470 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ usxMaxVsz

int XrdXrootdProtocol::usxMaxVsz = kXR_faMaxVlen
staticprotected

Definition at line 471 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ usxParms

char * XrdXrootdProtocol::usxParms = 0
staticprotected

Definition at line 472 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Window

int XrdXrootdProtocol::Window
staticprotected

Definition at line 434 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ wvInfo

XrdXrootdWVInfo* XrdXrootdProtocol::wvInfo
protected

Definition at line 588 of file XrdXrootdProtocol.hh.

◆ wvSeq

unsigned char XrdXrootdProtocol::wvSeq
protected

Definition at line 622 of file XrdXrootdProtocol.hh.

◆ XPList

XrdXrootdXPath XrdXrootdProtocol::XPList
staticprotected

Definition at line 398 of file XrdXrootdProtocol.hh.

Referenced by Configure().


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