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 565 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 573 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 457 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 453 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 895 of file XrdXrootdProtocol.cc.

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

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

◆ Claim()

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

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

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

Implements XrdSfsXio.

Definition at line 911 of file XrdXrootdProtocol.cc.

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

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

+ Here is the call graph for this function:

◆ CloseRequestCb()

bool XrdXrootdProtocol::CloseRequestCb ( void *  cbarg)
staticprotected

Definition at line 1541 of file XrdXrootdProtocol.cc.

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

References RequestClose().

+ Here is the call graph for this function:

◆ Configure()

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

Definition at line 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  if (pi->theEnv)
372  pi->theEnv->PutPtr("XrdXrootdRedirPI*", RedirPI);
373  }
374  }
375 
376 // Initialiaze for AIO. If we are not in debug mode and aio is enabled then we
377 // turn off async I/O if tghe filesystem requests it or if this is a caching
378 // proxy and we were asked not to use aio in such a cacse.
379 //
380  if (!(asyncFlags & asDebug) && as_aioOK)
381  {if (fsFeatures & XrdSfs::hasNAIO) as_aioOK = false;
382  else if (asyncFlags & asNoCache && fsFeatures & XrdSfs::hasCACH)
383  as_aioOK = false;
384  if (!as_aioOK) eDest.Say("Config asynchronous I/O has been disabled!");
385  }
386 
387 // Compute the maximum stutter allowed during async I/O (one per 64k)
388 //
389  if (as_segsize > 65536) as_okstutter = as_segsize/65536;
390 
391 // Establish final sendfile processing mode. This may be turned off by the
392 // link or by the SFS plugin usually because it's a proxy.
393 //
394  const char *why = 0;
395  if (!as_nosf)
396  {if (fsFeatures & XrdSfs::hasNOSF) why = "file system plugin.";
397  else if (!XrdLink::sfOK) why = "OS kernel.";
398  if (why)
399  {as_nosf = true;
400  eDest.Say("Config sendfile has been disabled by ", why);
401  }
402  }
403 
404 // Create the file lock manager and initialize file handling
405 //
408 
409 // Schedule protocol object cleanup (also advise the transit protocol)
410 //
411  ProtStack.Set(pi->Sched, &XrdXrootdTrace, TRACE_MEM);
412  n = (pi->ConnMax/3 ? pi->ConnMax/3 : 30);
413  ProtStack.Set(n, 60*60);
414  XrdXrootdTransit::Init(pi->Sched, n, 60*60);
415 
416 // Initialize the request ID generation object
417 //
418  PrepID = new XrdOucReqID(pi->urAddr, (int)Port);
419 
420 // Initialize for prepare processing
421 //
423  sprintf(buff, "%%s://%s:%d/&L=%%d&U=%%s", pi->myName, pi->Port);
424  Notify = strdup(buff);
425 
426 // Set the redirect flag if we are a pure redirector
427 //
428  int tlsFlags = myRole & kXR_tlsAny;
430  if ((rdf = getenv("XRDREDIRECT"))
431  && (!strcmp(rdf, "R") || !strcmp(rdf, "M")))
432  {isRedir = *rdf;
434  if (!strcmp(rdf, "M")) myRole |=kXR_attrMeta;
435  }
438  myRole |= tlsFlags;
439 
440 // Turn off client redirects if we are neither a redirector nor a proxy server
441 //
442  if (CL_Redir && !isRedir && !isProxy)
443  {CL_Redir = false;
444  eDest.Say("Config warning: 'redirect client' ignored; "
445  "not a redirector nor a proxy server");
446  }
447 
448 // Check if we are redirecting anything
449 //
450  if ((xp = RPList.Next()))
451  {int k;
452  char buff[2048], puff[1024];
453  do {k = xp->Opts();
454  if (Route[k].Host[0] == Route[k].Host[1]
455  && Route[k].Port[0] == Route[k].Port[1]) *puff = 0;
456  else sprintf(puff, "%%%s:%d", Route[k].Host[1], Route[k].Port[1]);
457  sprintf(buff," to %s:%d%s",Route[k].Host[0],Route[k].Port[0],puff);
458  eDest.Say("Config redirect static ", xp->Path(), buff);
459  xp = xp->Next();
460  } while(xp);
461  }
462 
463  if ((xp = RQList.Next()))
464  {int k;
465  const char *cgi1, *cgi2;
466  char buff[2048], puff[1024], xCgi[RD_Num] = {0};
467  if (isRedir) {cgi1 = "+"; cgi2 = getenv("XRDCMSCLUSTERID");}
468  else {cgi1 = ""; cgi2 = pi->myName;}
469  myCNlen = snprintf(buff, sizeof(buff), "%s%s", cgi1, cgi2);
470  myCName = strdup(buff);
471  do {k = xp->Opts();
472  if (Route[k].Host[0] == Route[k].Host[1]
473  && Route[k].Port[0] == Route[k].Port[1]) *puff = 0;
474  else sprintf(puff, "%%%s:%d", Route[k].Host[1], Route[k].Port[1]);
475  sprintf(buff," to %s:%d%s",Route[k].Host[0],Route[k].Port[0],puff);
476  eDest.Say("Config redirect enoent ", xp->Path(), buff);
477  if (!xCgi[k] && cgi2)
478  {bool isdup = Route[k].Host[0] == Route[k].Host[1]
479  && Route[k].Port[0] == Route[k].Port[1];
480  for (i = 0; i < 2; i++)
481  {n = snprintf(buff,sizeof(buff), "%s?tried=%s%s",
482  Route[k].Host[i], cgi1, cgi2);
483  free(Route[k].Host[i]); Route[k].Host[i] = strdup(buff);
484  Route[k].RDSz[i] = n;
485  if (isdup) {Route[k].Host[1] = Route[k].Host[0];
486  Route[k].RDSz[1] = n; break;
487  }
488  }
489  }
490  xCgi[k] = 1;
491  xp = xp->Next();
492  } while(xp);
493  }
494 
495 // Add all jobs that we can run to the admin object
496 //
497  if (JobCKS) XrdXrootdAdmin::addJob("chksum", JobCKS);
498 
499 // Establish the path to be used for admin functions. We will loose this
500 // storage upon an error but we don't care because we'll just exit.
501 //
502  adminp = XrdOucUtils::genPath(pi->AdmPath, 0, ".xrootd");
503 
504 // Setup the admin path (used in all roles).
505 //
506  if (!(AdminSock = XrdNetSocket::Create(&eDest, adminp, "admin", pi->AdmMode))
507  || !XrdXrootdAdmin::Init(&eDest, AdminSock)) return 0;
508 
509 // Indicate whether or not we support extended attributes
510 //
511  {XrdOucEnv myEnv;
512  XrdOucErrInfo eInfo("", &myEnv);
513  char buff[128];
514  if (osFS->FAttr(0, eInfo, 0) == SFS_OK)
515  {usxMaxNsz = myEnv.GetInt("usxMaxNsz");
516  if (usxMaxNsz < 0) usxMaxNsz = 0;
517  usxMaxVsz = myEnv.GetInt("usxMaxVsz");
518  if (usxMaxVsz < 0) usxMaxVsz = 0;
519  snprintf(buff, sizeof(buff), "%d %d", usxMaxNsz, usxMaxVsz);
520  usxParms = strdup(buff);
521  } else {
522  usxMaxNsz = 0;
523  usxMaxVsz = 0;
524  usxParms = strdup("0 0");
525  }
526  }
527 
528 // Finally, check if we really need to be in bypass mode if it is set
529 //
530  if (OD_Bypass)
531  {const char *penv = getenv("XRDXROOTD_PROXY");
532  if (!penv || *penv != '=')
533  {OD_Bypass = false;
534  eDest.Say("Config warning: 'fsoverload bypass' ignored; "
535  "not a forwarding proxy.");
536  }
537  }
538 
539 // Add any additional features
540 //
545  myRole |= kXR_anongpf;
546 
547 // Finally note whether or not we have TLS enabled
548 //
549  if (tlsCtx) myRole |= kXR_haveTLS;
550 
551 // Return success
552 //
553  free(adminp);
554  return 1;
555 }
#define kXR_isManager
Definition: XProtocol.hh:1198
#define kXR_suppgrw
Definition: XProtocol.hh:1216
#define kXR_attrMeta
Definition: XProtocol.hh:1201
#define kXR_haveTLS
Definition: XProtocol.hh:1221
#define kXR_anongpf
Definition: XProtocol.hh:1214
#define kXR_tlsAny
Definition: XProtocol.hh:1223
#define kXR_isServer
Definition: XProtocol.hh:1199
#define kXR_attrCache
Definition: XProtocol.hh:1200
#define kXR_attrProxy
Definition: XProtocol.hh:1202
#define kXR_LBalServer
Definition: XProtocol.hh:1193
#define kXR_supposc
Definition: XProtocol.hh:1217
#define kXR_DataServer
Definition: XProtocol.hh:1192
#define kXR_supgpf
Definition: XProtocol.hh:1215
#define DEBUG(x)
Definition: XrdBwmTrace.hh:54
XrdSfsFileSystem * XrdDigGetFS(XrdSfsFileSystem *native_fs, XrdSysLogger *lp, const char *cFN, const char *parms)
Definition: XrdDigFS.cc:105
#define SFS_OK
#define TRACE_MEM
Definition: XrdTrace.hh:38
#define TRACE(act, x)
Definition: XrdTrace.hh:63
#define TRACE_ALL
Definition: XrdTrace.hh:35
const char * XrdXrootdInstance
XrdSysTrace XrdXrootdTrace
XrdXrootdPrepare * XrdXrootdPrepQ
XrdOucString * XrdXrootdCF
int XrdXrootdPort
#define XROOTDXP_NOSLASH
static XrdNetIF netIF
Definition: XrdInet.hh:68
void Display(const char *pfx="=====> ")
Definition: XrdNetIF.cc:142
int Port()
Definition: XrdNetIF.hh:322
static XrdNetPMark * Config(XrdSysError *eLog, XrdScheduler *sched, XrdSysTrace *trc, bool &fatal)
static XrdNetSocket * Create(XrdSysError *Say, const char *path, const char *fn, mode_t mode, int isudp=0)
void Set(int inQMax, time_t agemax=1800)
Definition: XrdObject.icc:90
long GetInt(const char *varname)
Definition: XrdOucEnv.cc:253
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:188
void * GetPtr(const char *varname)
Definition: XrdOucEnv.cc:281
char * Get(const char *varname)
Definition: XrdOucEnv.hh:69
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:316
XrdOucTList * next
Definition: XrdOucTList.hh:45
char * text
Definition: XrdOucTList.hh:46
static char * genPath(const char *path, const char *inst, const char *psfx=0)
Definition: XrdOucUtils.cc:505
const char * myName
Definition: XrdProtocol.hh:82
XrdBuffManager * BPool
Definition: XrdProtocol.hh:63
XrdScheduler * Sched
Definition: XrdProtocol.hh:64
XrdTlsContext * tlsCtx
Definition: XrdProtocol.hh:99
const char * AdmPath
Definition: XrdProtocol.hh:76
XrdSysError * eDest
Definition: XrdProtocol.hh:61
XrdOucString * totalCF
Definition: XrdProtocol.hh:100
XrdOucEnv * theEnv
Definition: XrdProtocol.hh:66
const char * myInst
Definition: XrdProtocol.hh:81
XrdStats * Stats
Definition: XrdProtocol.hh:65
virtual int chksum(csFunc Func, const char *csName, const char *path, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0, const char *opaque=0)
virtual int FAttr(XrdSfsFACtl *faReq, XrdOucErrInfo &eInfo, const XrdSecEntity *client=0)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:116
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
Definition: XrdSysError.cc:162
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:175
void SetLogger(XrdSysLogger *logp)
Definition: XrdSysTrace.cc:65
static int Init(XrdSysError *erp, XrdNetSocket *asock)
static void addJob(const char *jname, XrdXrootdJob *jp)
static void setVals(XrdSysError *erp, XrdXrootdStats *SIp, XrdScheduler *schp, int port)
static void Init(XrdXrootdFileLock *lp, XrdSysError *erP, bool sfok)
static XrdXrootdStats * SI
static const char * myInst
static XrdSfsFileSystem * digFS
static XrdNetPMark * PMark
static short as_okstutter
static XrdXrootdXPath RPList
static XrdNetSocket * AdminSock
static XrdXrootdJob * JobCKS
static XrdSysError & eDest
static char * usxParms
static XrdXrootdRedirPI * RedirPI
static const char * myCName
static XrdXrootdFileLock * Locker
static XrdTlsContext * tlsCtx
static XrdXrootdXPath XPList
static XrdScheduler * Sched
static XrdOucTList * JobCKTLST
static XrdXrootdXPath RQList
static XrdBuffManager * BPool
static uint64_t fsFeatures
static XrdOucReqID * PrepID
static struct XrdXrootdProtocol::RD_Table Route[RD_Num]
static XrdSfsFileSystem * osFS
static void Init(XrdScheduler *schedP, int qMax, int qTTL)
Perform one-time initialization.
void Insert(const char *pd, int popt=0, int flags=XROOTDXP_OK)
XrdXrootdXPath * Next()
XrdSysLogger Logger
Definition: XrdGlobals.cc:47
static const int maxRvecsz
Definition: XProtocol.hh:722
static const uint64_t hasPGRW
Feature: pgRead and pgWrite.
Definition: XrdSfsFlags.hh:56
static const uint64_t hasPRP2
Feature: Prepare Handler Version 2 (different calling conventions)
Definition: XrdSfsFlags.hh:62
static const uint64_t hasGPFA
Feature: gpFile anonymous.
Definition: XrdSfsFlags.hh:53
static const uint64_t hasCACH
Feature: Implements a data cache.
Definition: XrdSfsFlags.hh:74
static const uint64_t hasNOSF
Feature: Supports no sendfile.
Definition: XrdSfsFlags.hh:71
static const uint64_t hasPOSC
Feature: Persist On Successful Close.
Definition: XrdSfsFlags.hh:59
static const uint64_t hasGPF
Feature: gpFile.
Definition: XrdSfsFlags.hh:50
static const uint64_t hasNAIO
Feature: Supports no async I/O.
Definition: XrdSfsFlags.hh:77
static const uint64_t hasPRXY
Feature: Proxy Server.
Definition: XrdSfsFlags.hh:65
XrdXrootdStats * SI
XrdScheduler * Sched
XrdBuffManager * BPool

References XrdXrootdAdmin::addJob(), AdminSock, XrdProtocol_Config::AdmMode, XrdProtocol_Config::AdmPath, XrdOucString::append(), XrdProtocol_Config::argc, XrdProtocol_Config::argv, as_aioOK, as_nosf, as_okstutter, as_segsize, XrdProtocol_Config::BPool, XrdXrootd::BPool, BPool, XrdOucString::c_str(), XrdSfsFileSystem::chksum(), CL_Redir, XrdNetPMarkCfg::Config(), XrdProtocol_Config::ConfigFN, XrdProtocol_Config::ConnMax, XrdNetSocket::Create(), XrdSfsFileSystem::csSize, DEBUG, XrdProtocol_Config::DebugON, digFS, XrdNetIF::Display(), XrdProtocol_Config::eDest, eDest, XrdSysError::Emsg(), XrdOucEnv::Export(), XrdSfsFileSystem::FAttr(), XrdSfsFileSystem::Features(), fsFeatures, XrdOucUtils::genPath(), XrdOucEnv::Get(), XrdOucErrInfo::getErrInfo(), XrdOucEnv::GetInt(), XrdOucEnv::GetPtr(), XrdProtocol_Config::hailWait, hailWait, XrdSfs::hasCACH, XrdSfs::hasGPF, XrdSfs::hasGPFA, XrdSfs::hasNAIO, XrdSfs::hasNOSF, XrdSfs::hasPGRW, XrdSfs::hasPOSC, XrdSfs::hasPRP2, XrdSfs::hasPRXY, XrdXrootdProtocol::RD_Table::Host, XrdXrootdTransit::Init(), XrdXrootdAdmin::Init(), XrdXrootdFile::Init(), 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, RedirPI, Route, RPList, RQList, XrdSysError::Say(), XrdProtocol_Config::Sched, XrdXrootd::Sched, Sched, XrdObjectQ< T >::Set(), XrdSysTrace::SetLogger(), XrdXrootdCallBack::setVals(), XrdLink::sfOK, SFS_OK, XrdXrootd::SI, SI, XrdProtocol_Config::Stats, XrdOucTList::text, XrdProtocol_Config::theEnv, XrdProtocol_Config::tlsCtx, tlsCtx, XrdProtocol_Config::tlsPort, tlsPort, XrdProtocol_Config::totalCF, TRACE, TRACE_ALL, TRACE_MEM, usxMaxNsz, usxMaxVsz, usxParms, XrdSysTrace::What, Window, XrdProtocol_Config::WSize, XPList, XrdDigGetFS(), XrdXrootdCF, XrdXrootdInstance, XrdXrootdPort, XrdXrootdPrepQ, XrdXrootdTrace, and XROOTDXP_NOSLASH.

Referenced by XrdgetProtocol().

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

◆ do_WriteSpan()

int XrdXrootdProtocol::do_WriteSpan ( )

Definition at line 3529 of file XrdXrootdXeq.cc.

3530 {
3531  int rc;
3533  numWrites++;
3534 
3535 // Unmarshall the data
3536 //
3538  n2hll(Request.write.offset, IO.Offset);
3539 
3540 // Find the file object. We will only drain socket data on the control path.
3541 // .
3542  if (!FTab || !(IO.File = FTab->Get(fh.handle)))
3543  {IO.IOLen -= myBlast;
3544  IO.File = 0;
3545  return do_WriteNone(Request.write.pathid);
3546  }
3547 
3548 // If we are monitoring, insert a write entry
3549 //
3550  if (Monitor.InOut())
3552  Request.write.offset);
3553  IO.File->Stats.wrOps(IO.IOLen); // Optimistically correct
3554 
3555 // Trace this entry
3556 //
3557  TRACEP(FSIO, "fh=" <<fh.handle <<" write " <<IO.IOLen <<'@' <<IO.Offset);
3558 
3559 // Write data that was already read
3560 //
3561  if ((rc = IO.File->XrdSfsp->write(IO.Offset, myBuff, myBlast)) < 0)
3562  {IO.IOLen = IO.IOLen-myBlast; IO.EInfo[0] = rc; IO.EInfo[1] = 0;
3563  return do_WriteNone();
3564  }
3565  IO.Offset += myBlast; IO.IOLen -= myBlast;
3566 
3567 // See if we need to finish this request in the normal way
3568 //
3569  if (IO.IOLen > 0) return do_WriteAll();
3570  return Response.Send();
3571 }
kXR_char fhandle[4]
Definition: XProtocol.hh:848
struct ClientRequestHdr header
Definition: XProtocol.hh:887
kXR_int64 offset
Definition: XProtocol.hh:849
struct ClientWriteRequest write
Definition: XProtocol.hh:918
kXR_int32 dlen
Definition: XProtocol.hh:161
#define TRACEP(act, x)
virtual XrdSfsXferSize write(XrdSfsFileOffset offset, const char *buffer, XrdSfsXferSize size)=0
XrdXrootdFile * Get(int fnum)
XrdSfsFile * XrdSfsp
XrdXrootdFileStats Stats
XrdXrootdMonitor * Agent
void Add_wr(kXR_unt32 dictid, kXR_int32 wlen, kXR_int64 offset)
XrdXrootd::IOParms IO
XrdXrootdFileTable * FTab
XrdXrootdMonitor::User Monitor
XrdXrootdResponse Response
XrdXrootdFile * File

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

+ Here is the call graph for this function:

◆ DoIt()

void XrdXrootdProtocol::DoIt ( )
inlineoverridevirtual

Implements XrdJob.

Definition at line 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 1404 of file XrdXrootdProtocol.cc.

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

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

Referenced by XrdXrootdAioTask::gdDone().

+ Here is the caller graph for this function:

◆ getPathID()

int XrdXrootdProtocol::getPathID ( )
inline

Definition at line 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:88
#define kXR_PROTOCOLVERSION
Definition: XProtocol.hh:70
kXR_int32 second
Definition: XProtocol.hh:86
unsigned int kXR_unt32
Definition: XPtypes.hh:90
unsigned short kXR_unt16
Definition: XPtypes.hh:67
#define ROOTD_PQ
T * Pop()
Definition: XrdObject.hh:93
void Bump(int &val)
Definition: XrdOucStats.hh:47
XrdNetAddrInfo * addrInfo
Entity's connection details.
Definition: XrdSecEntity.hh:80
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
Definition: XrdSecEntity.hh:67
char * host
Entity's host name dnr dependent.
Definition: XrdSecEntity.hh:70
void Set(XrdLink *lp)

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

+ Here is the call graph for this function:

◆ MonAuth()

void XrdXrootdProtocol::MonAuth ( )
protected

Definition at line 4416 of file XrdXrootdXeq.cc.

4417 {
4418  char Buff[4096];
4419  const char *bP = Buff;
4420 
4421  if (Client == &Entity) bP = Entity.moninfo;
4422  else {snprintf(Buff,sizeof(Buff),
4423  "&p=%s&n=%s&h=%s&o=%s&r=%s&g=%s&m=%s%s&I=%c",
4424  Client->prot,
4425  (Client->name ? Client->name : ""),
4426  (Client->host ? Client->host : ""),
4427  (Client->vorg ? Client->vorg : ""),
4428  (Client->role ? Client->role : ""),
4429  (Client->grps ? Client->grps : ""),
4430  (Client->moninfo ? Client->moninfo : ""),
4431  (Entity.moninfo ? Entity.moninfo : ""),
4432  (clientPV & XrdOucEI::uIPv4 ? '4' : '6')
4433  );
4434  Client->secMon = &Monitor;
4435  }
4436 
4437  Monitor.Report(bP);
4438  if (Entity.moninfo) {free(Entity.moninfo); Entity.moninfo = 0;}
4439 }
char * vorg
Entity's virtual organization(s)
Definition: XrdSecEntity.hh:71
XrdSecMonitor * secMon
If !0 security monitoring enabled.
Definition: XrdSecEntity.hh:89
char * grps
Entity's group name(s)
Definition: XrdSecEntity.hh:73
char * name
Entity's name.
Definition: XrdSecEntity.hh:69
char * role
Entity's role(s)
Definition: XrdSecEntity.hh:72
char * moninfo
Information for monitoring.
Definition: XrdSecEntity.hh:76
void Report(const char *Info)
XrdSecEntity * Client
static const int uIPv4
ucap: Supports read redirects

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

+ Here is the call graph for this function:

◆ operator=()

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

◆ Process()

int XrdXrootdProtocol::Process ( XrdLink lp)
overridevirtual

Implements XrdProtocol.

Reimplemented in XrdXrootdTransit.

Definition at line 368 of file XrdXrootdProtocol.cc.

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

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

Referenced by XrdXrootdTransit::Process().

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

◆ Process2()

int XrdXrootdProtocol::Process2 ( )

Definition at line 439 of file XrdXrootdProtocol.cc.

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

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

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

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

◆ ProcSig()

int XrdXrootdProtocol::ProcSig ( )

Definition at line 616 of file XrdXrootdProtocol.cc.

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

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

Referenced by Process().

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

◆ Reclaim()

void XrdXrootdProtocol::Reclaim ( XrdSfsXioHandle  h)
static

Definition at line 926 of file XrdXrootdProtocol.cc.

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

References BPool, and XrdBuffManager::Release().

+ Here is the call graph for this function:

◆ Recycle()

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

Implements XrdProtocol.

Reimplemented in XrdXrootdTransit.

Definition at line 661 of file XrdXrootdProtocol.cc.

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

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

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

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

◆ RequestClose()

bool XrdXrootdProtocol::RequestClose ( )
protected

Definition at line 1551 of file XrdXrootdProtocol.cc.

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

References CloseRequested, and unbindMutex.

Referenced by CloseRequestCb().

+ Here is the caller graph for this function:

◆ SendFile() [1/2]

int XrdXrootdProtocol::SendFile ( int  fildes)
overridevirtual

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

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

Implements XrdSfsDio.

Definition at line 3806 of file XrdXrootdXeq.cc.

3807 {
3808 
3809 // Make sure we have some data to send
3810 //
3811  if (!IO.IOLen) return 1;
3812 
3813 // Send off the data
3814 //
3815  IO.IOLen = Response.Send(fildes, IO.Offset, IO.IOLen);
3816  return IO.IOLen;
3817 }

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

3822 {
3823  int i, xframt = 0;
3824 
3825 // Make sure we have some data to send
3826 //
3827  if (!IO.IOLen) return 1;
3828 
3829 // Verify the length, it can't be greater than what the client wants
3830 //
3831  for (i = 1; i < sfvnum; i++) xframt += sfvec[i].sendsz;
3832  if (xframt > IO.IOLen) return 1;
3833 
3834 // Send off the data
3835 //
3836  if (xframt) IO.IOLen = Response.Send(sfvec, sfvnum, xframt);
3837  else {IO.IOLen = 0; Response.Send();}
3838  return IO.IOLen;
3839 }

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

3846 {
3847  if (fildes < 0) IO.File->sfEnabled = 0;
3848  else IO.File->fdNum = fildes;
3849 }

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

◆ SetSF()

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

Definition at line 4485 of file XrdXrootdXeq.cc.

4486 {
4487  XrdXrootdFHandle fh(fhandle);
4488  XrdXrootdFile *theFile;
4489 
4490  if (!FTab || !(theFile = FTab->Get(fh.handle))) return -EBADF;
4491 
4492 // Turn it off or on if so wanted
4493 //
4494  if (!seton) theFile->sfEnabled = 0;
4495  else if (theFile->fdNum >= 0) theFile->sfEnabled = 1;
4496 
4497 // All done
4498 //
4499  return 0;
4500 }

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

Referenced by XrdXrootdTransit::setSF().

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

◆ Stats()

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

Implements XrdProtocol.

Definition at line 857 of file XrdXrootdProtocol.cc.

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

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

+ Here is the call graph for this function:

◆ StreamNOP()

void XrdXrootdProtocol::StreamNOP ( )

Definition at line 936 of file XrdXrootdProtocol.cc.

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

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

+ Here is the call graph for this function:

◆ Swap()

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

Swap the current I/O buffer

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

Implements XrdSfsXio.

Definition at line 952 of file XrdXrootdProtocol.cc.

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

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

Referenced by Claim().

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

◆ VerifyStream()

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

Definition at line 977 of file XrdXrootdProtocol.cc.

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

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

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ XrdXrootdAdmin

friend class XrdXrootdAdmin
friend

Definition at line 161 of file XrdXrootdProtocol.hh.

Member Data Documentation

◆ ableTLS

bool XrdXrootdProtocol::ableTLS
protected

Definition at line 627 of file XrdXrootdProtocol.hh.

◆ AdminSock

XrdNetSocket * XrdXrootdProtocol::AdminSock = 0
staticprotected

Definition at line 429 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ AppName

char* XrdXrootdProtocol::AppName
protected

Definition at line 537 of file XrdXrootdProtocol.hh.

◆ argp

XrdBuffer* XrdXrootdProtocol::argp
protected

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

◆ boundRecycle

XrdSysSemaphore* XrdXrootdProtocol::boundRecycle
protected

Definition at line 608 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ BPool

XrdBuffManager * XrdXrootdProtocol::BPool
staticprotected

Definition at line 408 of file XrdXrootdProtocol.hh.

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

◆ CapVer

unsigned char XrdXrootdProtocol::CapVer
protected

Definition at line 528 of file XrdXrootdProtocol.hh.

◆ CIA

XrdSecService * XrdXrootdProtocol::CIA = 0
staticprotected

Definition at line 403 of file XrdXrootdProtocol.hh.

◆ CL_Redir

bool XrdXrootdProtocol::CL_Redir = false
staticprotected

Definition at line 466 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ Client

XrdSecEntity* XrdXrootdProtocol::Client
protected

Definition at line 533 of file XrdXrootdProtocol.hh.

Referenced by MonAuth().

◆ clientPV

int XrdXrootdProtocol::clientPV
protected

Definition at line 522 of file XrdXrootdProtocol.hh.

Referenced by MonAuth().

◆ clientRN

int XrdXrootdProtocol::clientRN
protected

Definition at line 523 of file XrdXrootdProtocol.hh.

◆ CloseRequested

bool XrdXrootdProtocol::CloseRequested
protected

Definition at line 529 of file XrdXrootdProtocol.hh.

Referenced by RequestClose().

◆ cumReadP

int XrdXrootdProtocol::cumReadP
protected

Definition at line 506 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumReads

int XrdXrootdProtocol::cumReads
protected

Definition at line 505 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumReadV

int XrdXrootdProtocol::cumReadV
protected

Definition at line 507 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumSegsV

int XrdXrootdProtocol::cumSegsV
protected

Definition at line 508 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumSegsW

int XrdXrootdProtocol::cumSegsW
protected

Definition at line 510 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumWrites

int XrdXrootdProtocol::cumWrites
protected

Definition at line 511 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ cumWritV

int XrdXrootdProtocol::cumWritV
protected

Definition at line 509 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ DHS

XrdSecProtector * XrdXrootdProtocol::DHS = 0
staticprotected

Definition at line 404 of file XrdXrootdProtocol.hh.

◆ digFS

XrdSfsFileSystem * XrdXrootdProtocol::digFS = 0
staticprotected

Definition at line 402 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ doTLS

char XrdXrootdProtocol::doTLS
protected

Definition at line 626 of file XrdXrootdProtocol.hh.

◆ eDest

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

Definition at line 409 of file XrdXrootdProtocol.hh.

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

◆ endNote

XrdSysCondVar2* XrdXrootdProtocol::endNote
protected

Definition at line 609 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ Entity

XrdSecEntity XrdXrootdProtocol::Entity
protected

Definition at line 535 of file XrdXrootdProtocol.hh.

Referenced by Match(), and MonAuth().

◆ fsFeatures

uint64_t XrdXrootdProtocol::fsFeatures = 0
staticprotected

Definition at line 449 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ FTab

XrdXrootdFileTable* XrdXrootdProtocol::FTab
protected

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

Referenced by Configure(), and Match().

◆ halfBSize

int XrdXrootdProtocol::halfBSize
protected

Definition at line 601 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ hcMax

int XrdXrootdProtocol::hcMax = 28657
staticprotected

Definition at line 597 of file XrdXrootdProtocol.hh.

◆ hcNext

int XrdXrootdProtocol::hcNext
protected

Definition at line 599 of file XrdXrootdProtocol.hh.

◆ hcNow

int XrdXrootdProtocol::hcNow
protected

Definition at line 600 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ hcPrev

int XrdXrootdProtocol::hcPrev
protected

Definition at line 598 of file XrdXrootdProtocol.hh.

Referenced by Process().

◆ IO

XrdXrootd::IOParms XrdXrootdProtocol::IO
protected

Definition at line 593 of file XrdXrootdProtocol.hh.

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

◆ isActive

bool XrdXrootdProtocol::isActive
protected

Definition at line 612 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ isLinkWT

bool XrdXrootdProtocol::isLinkWT
protected

Definition at line 613 of file XrdXrootdProtocol.hh.

Referenced by Recycle().

◆ isNOP

bool XrdXrootdProtocol::isNOP
protected

Definition at line 614 of file XrdXrootdProtocol.hh.

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

◆ isProxy

bool XrdXrootdProtocol::isProxy = false
staticprotected

Definition at line 468 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ isRedir

char XrdXrootdProtocol::isRedir = 0
staticprotected

Definition at line 442 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Match().

◆ isTLS

bool XrdXrootdProtocol::isTLS
protected

Definition at line 628 of file XrdXrootdProtocol.hh.

◆ JobCKCGI

char XrdXrootdProtocol::JobCKCGI =0
staticprotected

Definition at line 444 of file XrdXrootdProtocol.hh.

◆ JobCKS

XrdXrootdJob * XrdXrootdProtocol::JobCKS = 0
staticprotected

Definition at line 445 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobCKT

char * XrdXrootdProtocol::JobCKT = 0
staticprotected

Definition at line 446 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobCKTLST

XrdOucTList * XrdXrootdProtocol::JobCKTLST = 0
staticprotected

Definition at line 447 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ JobLCL

char XrdXrootdProtocol::JobLCL = 0
staticprotected

Definition at line 443 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ keepT

time_t XrdXrootdProtocol::keepT = 86400
staticprotected

Definition at line 425 of file XrdXrootdProtocol.hh.

◆ LimitError

bool XrdXrootdProtocol::LimitError = true
staticprotected

Definition at line 633 of file XrdXrootdProtocol.hh.

◆ Link

◆ linkAioReq

RAtomic_int XrdXrootdProtocol::linkAioReq
protected

Definition at line 551 of file XrdXrootdProtocol.hh.

Referenced by aioUpdReq().

◆ Locker

XrdXrootdFileLock * XrdXrootdProtocol::Locker
staticprotected

Definition at line 406 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxBuffsz

int XrdXrootdProtocol::maxBuffsz
staticprotected

Definition at line 489 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ maxPio

const int XrdXrootdProtocol::maxPio = 4
staticprotected

Definition at line 616 of file XrdXrootdProtocol.hh.

◆ maxReadv_ior

int XrdXrootdProtocol::maxReadv_ior
staticprotected
Initial value:

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

Referenced by Configure().

◆ Monitor

XrdXrootdMonitor::User XrdXrootdProtocol::Monitor
protected

Definition at line 520 of file XrdXrootdProtocol.hh.

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

◆ myBlast

int XrdXrootdProtocol::myBlast
protected

Definition at line 559 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan().

◆ myBlen

int XrdXrootdProtocol::myBlen
protected

Definition at line 558 of file XrdXrootdProtocol.hh.

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

◆ myBuff

char* XrdXrootdProtocol::myBuff
protected

Definition at line 557 of file XrdXrootdProtocol.hh.

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

◆ myCName

const char * XrdXrootdProtocol::myCName = 0
staticprotected

Definition at line 440 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myCNlen

int XrdXrootdProtocol::myCNlen = 0
staticprotected

Definition at line 441 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myGID

gid_t XrdXrootdProtocol::myGID = 0
staticprotected

Definition at line 419 of file XrdXrootdProtocol.hh.

◆ myGName

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

Definition at line 423 of file XrdXrootdProtocol.hh.

◆ myGNLen

int XrdXrootdProtocol::myGNLen = 1
staticprotected

Definition at line 421 of file XrdXrootdProtocol.hh.

◆ myInst

const char * XrdXrootdProtocol::myInst = 0
staticprotected

Definition at line 412 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myPID

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

Definition at line 415 of file XrdXrootdProtocol.hh.

◆ myRole

int XrdXrootdProtocol::myRole = 0
staticprotected

Definition at line 416 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ myRolf

int XrdXrootdProtocol::myRolf = 0
staticprotected

Definition at line 417 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ mySID

unsigned int XrdXrootdProtocol::mySID
protected

Definition at line 611 of file XrdXrootdProtocol.hh.

◆ myStalls

int XrdXrootdProtocol::myStalls
protected

Definition at line 512 of file XrdXrootdProtocol.hh.

◆ myUID

uid_t XrdXrootdProtocol::myUID = 0
staticprotected

Definition at line 420 of file XrdXrootdProtocol.hh.

◆ myUName

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

Definition at line 424 of file XrdXrootdProtocol.hh.

◆ myUNLen

int XrdXrootdProtocol::myUNLen = 1
staticprotected

Definition at line 422 of file XrdXrootdProtocol.hh.

◆ newPio

bool XrdXrootdProtocol::newPio
protected

Definition at line 622 of file XrdXrootdProtocol.hh.

◆ Notify

char * XrdXrootdProtocol::Notify = 0
staticprotected

Definition at line 439 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ numFiles

int XrdXrootdProtocol::numFiles
protected

Definition at line 503 of file XrdXrootdProtocol.hh.

◆ numReadP

int XrdXrootdProtocol::numReadP
protected

Definition at line 497 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numReads

int XrdXrootdProtocol::numReads
protected

Definition at line 496 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numReadV

int XrdXrootdProtocol::numReadV
protected

Definition at line 498 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numSegsV

int XrdXrootdProtocol::numSegsV
protected

Definition at line 499 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numSegsW

int XrdXrootdProtocol::numSegsW
protected

Definition at line 501 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ numWrites

int XrdXrootdProtocol::numWrites
protected

Definition at line 502 of file XrdXrootdProtocol.hh.

Referenced by do_WriteSpan(), and Stats().

◆ numWritV

int XrdXrootdProtocol::numWritV
protected

Definition at line 500 of file XrdXrootdProtocol.hh.

Referenced by Stats().

◆ OD_Bypass

bool XrdXrootdProtocol::OD_Bypass = false
staticprotected

Definition at line 463 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ OD_Redir

bool XrdXrootdProtocol::OD_Redir = false
staticprotected

Definition at line 464 of file XrdXrootdProtocol.hh.

◆ OD_Stall

int XrdXrootdProtocol::OD_Stall = 33
staticprotected

Definition at line 462 of file XrdXrootdProtocol.hh.

◆ osFS

XrdSfsFileSystem * XrdXrootdProtocol::osFS
staticprotected

Definition at line 401 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ PathID

short XrdXrootdProtocol::PathID
protected

Definition at line 621 of file XrdXrootdProtocol.hh.

Referenced by getPathID(), and StreamNOP().

◆ pgwCtl

XrdXrootdPgwCtl* XrdXrootdProtocol::pgwCtl
protected

Definition at line 556 of file XrdXrootdProtocol.hh.

◆ pioFirst

XrdXrootdPio* XrdXrootdProtocol::pioFirst
protected

Definition at line 617 of file XrdXrootdProtocol.hh.

◆ pioFree

XrdXrootdPio* XrdXrootdProtocol::pioFree
protected

Definition at line 619 of file XrdXrootdProtocol.hh.

◆ pioLast

XrdXrootdPio* XrdXrootdProtocol::pioLast
protected

Definition at line 618 of file XrdXrootdProtocol.hh.

◆ PMark

XrdNetPMark * XrdXrootdProtocol::PMark = 0
staticprotected

Definition at line 410 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ pmDone

bool XrdXrootdProtocol::pmDone
protected

Definition at line 524 of file XrdXrootdProtocol.hh.

◆ pmHandle

XrdNetPMark::Handle* XrdXrootdProtocol::pmHandle
protected

Definition at line 521 of file XrdXrootdProtocol.hh.

◆ Port

int XrdXrootdProtocol::Port
staticprotected

Definition at line 435 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ PrepareAlt

bool XrdXrootdProtocol::PrepareAlt = false
staticprotected

Definition at line 632 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ PrepareCount

int XrdXrootdProtocol::PrepareCount
protected

Definition at line 635 of file XrdXrootdProtocol.hh.

◆ PrepareLimit

int XrdXrootdProtocol::PrepareLimit = -1
staticprotected

Definition at line 636 of file XrdXrootdProtocol.hh.

◆ PrepID

XrdOucReqID * XrdXrootdProtocol::PrepID = 0
staticprotected

Definition at line 448 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Protect

XrdSecProtect* XrdXrootdProtocol::Protect
protected

Definition at line 536 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ rdType

short XrdXrootdProtocol::rdType
protected

Definition at line 526 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ readWait

int XrdXrootdProtocol::readWait
staticprotected

Definition at line 434 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ redirIPHold

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

Definition at line 438 of file XrdXrootdProtocol.hh.

◆ RedirPI

XrdXrootdRedirPI * XrdXrootdProtocol::RedirPI = 0
staticprotected

Definition at line 411 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Req_TLSData

const char XrdXrootdProtocol::Req_TLSData = 0x01
staticprotected

Definition at line 478 of file XrdXrootdProtocol.hh.

◆ Req_TLSGPFile

const char XrdXrootdProtocol::Req_TLSGPFile = 0x02
staticprotected

Definition at line 479 of file XrdXrootdProtocol.hh.

◆ Req_TLSLogin

const char XrdXrootdProtocol::Req_TLSLogin = 0x04
staticprotected

Definition at line 480 of file XrdXrootdProtocol.hh.

◆ Req_TLSSess

const char XrdXrootdProtocol::Req_TLSSess = 0x08
staticprotected

Definition at line 481 of file XrdXrootdProtocol.hh.

◆ Req_TLSTPC

const char XrdXrootdProtocol::Req_TLSTPC = 0x10
staticprotected

Definition at line 482 of file XrdXrootdProtocol.hh.

◆ ReqID

XrdXrootdReqID XrdXrootdProtocol::ReqID
protected

Definition at line 640 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ Request

ClientRequest XrdXrootdProtocol::Request
protected

◆ reserved

char XrdXrootdProtocol::reserved[3]
protected

Definition at line 525 of file XrdXrootdProtocol.hh.

◆ Response

XrdXrootdResponse XrdXrootdProtocol::Response
protected

◆ Resume

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

◆ ResumePio

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

Definition at line 591 of file XrdXrootdProtocol.hh.

◆ reTry

XrdSysSemaphore* XrdXrootdProtocol::reTry
protected

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

Referenced by Configure().

◆ RQList

XrdXrootdXPath XrdXrootdProtocol::RQList
staticprotected

Definition at line 399 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ RQLxist

int XrdXrootdProtocol::RQLxist = 0
staticprotected

Definition at line 414 of file XrdXrootdProtocol.hh.

◆ rvSeq

unsigned char XrdXrootdProtocol::rvSeq
protected

Definition at line 623 of file XrdXrootdProtocol.hh.

◆ Sched

XrdScheduler * XrdXrootdProtocol::Sched
staticprotected

Definition at line 407 of file XrdXrootdProtocol.hh.

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

◆ SI

XrdXrootdStats * XrdXrootdProtocol::SI
staticprotected

Definition at line 495 of file XrdXrootdProtocol.hh.

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

◆ sigBuff

char XrdXrootdProtocol::sigBuff[64]
protected

Definition at line 543 of file XrdXrootdProtocol.hh.

Referenced by ProcSig().

◆ sigHere

bool XrdXrootdProtocol::sigHere
protected

Definition at line 545 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and ProcSig().

◆ sigNeed

bool XrdXrootdProtocol::sigNeed
protected

Definition at line 544 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ sigRead

bool XrdXrootdProtocol::sigRead
protected

Definition at line 546 of file XrdXrootdProtocol.hh.

Referenced by ProcSig().

◆ sigReq

SecurityRequest XrdXrootdProtocol::sigReq
protected

Definition at line 542 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and ProcSig().

◆ sigReq2Ver

ClientRequest XrdXrootdProtocol::sigReq2Ver
protected

Definition at line 541 of file XrdXrootdProtocol.hh.

Referenced by Process(), and Process2().

◆ sigWarn

bool XrdXrootdProtocol::sigWarn
protected

Definition at line 547 of file XrdXrootdProtocol.hh.

Referenced by Process2().

◆ srvrAioOps

RAtomic_int XrdXrootdProtocol::srvrAioOps = {0}
staticprotected

Definition at line 552 of file XrdXrootdProtocol.hh.

Referenced by aioUpdate().

◆ Status

char XrdXrootdProtocol::Status
protected

Definition at line 527 of file XrdXrootdProtocol.hh.

Referenced by Process2(), and Recycle().

◆ Stream

XrdXrootdProtocol* XrdXrootdProtocol::Stream[maxStreams]
protected

Definition at line 610 of file XrdXrootdProtocol.hh.

Referenced by VerifyStream().

◆ streamMutex

XrdSysMutex XrdXrootdProtocol::streamMutex
protected

Definition at line 606 of file XrdXrootdProtocol.hh.

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

◆ tlsCap

char XrdXrootdProtocol::tlsCap = 0
staticprotected

Definition at line 484 of file XrdXrootdProtocol.hh.

◆ tlsCtx

XrdTlsContext * XrdXrootdProtocol::tlsCtx = 0
staticprotected

Definition at line 405 of file XrdXrootdProtocol.hh.

Referenced by Configure(), and Process2().

◆ tlsNot

char XrdXrootdProtocol::tlsNot = 0
staticprotected

Definition at line 485 of file XrdXrootdProtocol.hh.

◆ tlsPort

int XrdXrootdProtocol::tlsPort = 0
staticprotected

Definition at line 437 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ totReadP

long long XrdXrootdProtocol::totReadP
protected

Definition at line 513 of file XrdXrootdProtocol.hh.

◆ TraceID

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

Definition at line 413 of file XrdXrootdProtocol.hh.

◆ unbindMutex

XrdSysMutex XrdXrootdProtocol::unbindMutex
protected

Definition at line 605 of file XrdXrootdProtocol.hh.

Referenced by Recycle(), and RequestClose().

◆ usxMaxNsz

int XrdXrootdProtocol::usxMaxNsz = kXR_faMaxNlen
staticprotected

Definition at line 472 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ usxMaxVsz

int XrdXrootdProtocol::usxMaxVsz = kXR_faMaxVlen
staticprotected

Definition at line 473 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ usxParms

char * XrdXrootdProtocol::usxParms = 0
staticprotected

Definition at line 474 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ Window

int XrdXrootdProtocol::Window
staticprotected

Definition at line 436 of file XrdXrootdProtocol.hh.

Referenced by Configure().

◆ wvInfo

XrdXrootdWVInfo* XrdXrootdProtocol::wvInfo
protected

Definition at line 590 of file XrdXrootdProtocol.hh.

◆ wvSeq

unsigned char XrdXrootdProtocol::wvSeq
protected

Definition at line 624 of file XrdXrootdProtocol.hh.

◆ XPList

XrdXrootdXPath XrdXrootdProtocol::XPList
staticprotected

Definition at line 400 of file XrdXrootdProtocol.hh.

Referenced by Configure().


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