XRootD
Loading...
Searching...
No Matches
XrdOucErrInfo Class Reference

#include <XrdOucErrInfo.hh>

Inheritance diagram for XrdOucErrInfo:
Collaboration diagram for XrdOucErrInfo:

Public Member Functions

 XrdOucErrInfo (const char *user, int MonID, int uc=0)
 XrdOucErrInfo (const char *user, XrdOucEnv *envp, int uc=0)
 XrdOucErrInfo (const char *user=0, XrdOucEICB *cb=0, unsigned long long ca=0, int mid=0, int uc=0)
virtual ~XrdOucErrInfo ()
 Destructor.
void clear ()
 Reset data and error information to null. Any appenadges are released.
bool extData ()
XrdOucEnv * getEnv ()
unsigned long long getErrArg ()
XrdOucEICB * getErrCB ()
XrdOucEICB * getErrCB (unsigned long long &ap)
const char * getErrData ()
int getErrInfo ()
int getErrMid ()
const char * getErrText ()
const char * getErrText (int &ecode)
int getErrTextLen ()
const char * getErrUser ()
char * getMsgBuff (int &mblen)
int getUCap ()
XrdOucErrInfo & operator= (const XrdOucErrInfo &rhs)
 Assignment operator.
void Reset ()
 Reset object to no message state. Call this method to release appendages.
XrdOucEnv * setEnv (XrdOucEnv *newEnv)
void setErrArg (unsigned long long cbarg=0)
void setErrCB (XrdOucEICB *cb, unsigned long long cbarg=0)
int setErrCode (int code)
void setErrData (const char *Data, int Offs=0)
int setErrInfo (int code, const char *emsg)
int setErrInfo (int code, const char *txtlist[], int n)
int setErrInfo (int code, XrdOucBuffer *buffP)
void setErrMid (int mid)
 Set the monitoring identifier.
void setErrUser (const char *user)
void setUCap (int ucval)
 Set user capabilties.

Protected Attributes

union { 
unsigned long long ErrCBarg
XrdOucEnv * ErrEnv
}; 
XrdOucBuffer * dataBuff
short dOff
XrdOucEICB * ErrCB
XrdOucEI ErrInfo
int mID
short reserved

Detailed Description

The XrdOucErrInfo class is used to communicate data, error, and callback information between plug-ins.

Definition at line 100 of file XrdOucErrInfo.hh.

Constructor & Destructor Documentation

◆ XrdOucErrInfo() [1/3]

XrdOucErrInfo::XrdOucErrInfo ( const char * user = 0,
XrdOucEICB * cb = 0,
unsigned long long ca = 0,
int mid = 0,
int uc = 0 )
inline

Constructor

Parameters
user- Pointer to he user string in stable storage.
cb- Pointer to the callback object (zero if none).
ca- The callback argument.
mid- The monitoring identifier.
uc- The user capabilities.

Definition at line 422 of file XrdOucErrInfo.hh.

424 : ErrInfo(user, uc), ErrCB(cb), ErrCBarg(ca), mID(mid),
425 dOff(-1), reserved(0), dataBuff(0) {}
XrdOucBuffer * dataBuff
XrdOucEICB * ErrCB

References dataBuff, dOff, ErrCB, ErrInfo, mID, and reserved.

Referenced by XrdCmsResp::XrdCmsResp(), XrdCmsResp::Alloc(), XrdBwmHandleCB::Done(), XrdCmsResp::Done(), operator=(), and XrdCmsResp::XrdCmsRespQ.

Here is the caller graph for this function:

◆ XrdOucErrInfo() [2/3]

XrdOucErrInfo::XrdOucErrInfo ( const char * user,
XrdOucEnv * envp,
int uc = 0 )
inline

Constructor

Parameters
user- Pointer to he user string in stable storage.
envp- Pointer to the error environment.
uc- The user capabilities.

Definition at line 435 of file XrdOucErrInfo.hh.

436 : ErrInfo(user, uc), ErrCB(0), ErrEnv(envp), mID(0),
437 dOff(-1), reserved(0), dataBuff(0) {}

References dataBuff, dOff, ErrCB, ErrInfo, mID, and reserved.

◆ XrdOucErrInfo() [3/3]

XrdOucErrInfo::XrdOucErrInfo ( const char * user,
int MonID,
int uc = 0 )
inline

Constructor

Parameters
user- Pointer to he user string in stable storage.
MonID- The monitoring identifier.
uc- The user capabilities.

Definition at line 447 of file XrdOucErrInfo.hh.

448 : ErrInfo(user, uc), ErrCB(0), ErrCBarg(0), mID(MonID),
449 dOff(-1), reserved(0), dataBuff(0) {}

References dataBuff, dOff, ErrCB, ErrInfo, mID, and reserved.

◆ ~XrdOucErrInfo()

virtual XrdOucErrInfo::~XrdOucErrInfo ( )
inlinevirtual

Destructor.

Definition at line 455 of file XrdOucErrInfo.hh.

455{Reset();}
void Reset()
Reset object to no message state. Call this method to release appendages.

References Reset().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void XrdOucErrInfo::clear ( )
inline

Reset data and error information to null. Any appenadges are released.

Definition at line 108 of file XrdOucErrInfo.hh.

108{Reset(); ErrInfo.clear();}

References ErrInfo, and Reset().

Here is the call graph for this function:

◆ extData()

bool XrdOucErrInfo::extData ( )
inline

Check if this object will return extended data (can optimize Reset() calls).

Returns
true - there is extended data. false - there is no extended data.

Definition at line 371 of file XrdOucErrInfo.hh.

371{return (dataBuff != 0);}

References dataBuff.

Referenced by XrdOfs::Emsg(), XrdXrootdAioTask::SendFSError(), XrdXrootdCallBack::sendResp(), and XrdXrootdCallBack::sendVesp().

Here is the caller graph for this function:

◆ getEnv()

XrdOucEnv * XrdOucErrInfo::getEnv ( )
inline

Get a pointer to the error environment that was previously set.

Returns
=0 - A callback is in effect which is mutually exclusive of conaining an error environment (i.e. no environment).
!0 - Pointer to the error environment.

Definition at line 307 of file XrdOucErrInfo.hh.

307{return (ErrCB ? 0 : ErrEnv);}

References ErrCB.

Referenced by XrdOfs::chksum(), XrdOfs::FAttr(), XrdSecPManager::Get(), XrdSecProtocolgsi::getCredentials(), XrdSecProtocolkrb5::getCredentials(), XrdSecProtocolsss::getCredentials(), and XrdSecProtocolsss::Load_Client().

Here is the caller graph for this function:

◆ getErrArg()

unsigned long long XrdOucErrInfo::getErrArg ( )
inline

Obtain the callback argument.

Returns
The argument value currently in effect.

Definition at line 203 of file XrdOucErrInfo.hh.

203{return ErrCBarg;}

Referenced by XrdXrootdCallBack::sendResp(), and XrdXrootdCallBack::sendVesp().

Here is the caller graph for this function:

◆ getErrCB() [1/2]

XrdOucEICB * XrdOucErrInfo::getErrCB ( )
inline

Get the callback object.

Returns
Pointer to the callback object.

Definition at line 224 of file XrdOucErrInfo.hh.

224{return ErrCB;}

References ErrCB.

Referenced by XrdOfsEvr::theClient::theClient(), XrdBwmHandle::Activate(), XrdCmsResp::Alloc(), XrdOucCallBack::Allowed(), XrdXrootdCallBack::Done(), XrdOucCallBack::Init(), and XrdSsiFileReq::WantResponse().

Here is the caller graph for this function:

◆ getErrCB() [2/2]

XrdOucEICB * XrdOucErrInfo::getErrCB ( unsigned long long & ap)
inline

Get the callback object and its argument.

Parameters
ap- Reference to where the callback argument is returned.
Returns
Pointer to the callback object, ap holds the argument.

Definition at line 234 of file XrdOucErrInfo.hh.

235 {ap = ErrCBarg; return ErrCB;}

References ErrCB.

◆ getErrData()

const char * XrdOucErrInfo::getErrData ( )
inline

Get the error tracing data.

Returns
=0 - No tracing data has been set.
!0 - Pointer to error tracing data.

Definition at line 333 of file XrdOucErrInfo.hh.

333{return (dOff < 0 ? 0 : ErrInfo.message+dOff);}

References dOff, and ErrInfo.

Referenced by XrdCmsResp::Alloc(), and XrdCmsParser::Decode().

Here is the caller graph for this function:

◆ getErrInfo()

int XrdOucErrInfo::getErrInfo ( )
inline

Get the error code.

Returns
The error code that was previously set.

Definition at line 243 of file XrdOucErrInfo.hh.

243{return ErrInfo.code;}

References ErrInfo.

Referenced by XrdSecsssKT::XrdSecsssKT(), XrdXrootdProtocol::Configure(), XrdCmsClientMan::delayResp(), XrdSecPManager::Get(), XrdSecProtocolsss::Init_Client(), XrdSecProtocolsss::Load_Client(), XrdSecProtocolsss::Load_Server(), XrdCmsRedirLocal::Locate(), main(), XrdPssFile::Open(), XrdSecsssKT::Refresh(), XrdOfs::rename(), XrdSecsssAdmin_addKey(), XrdSecsssAdmin_delKey(), XrdSecsssAdmin_insKey(), and XrdSecsssAdmin_lstKey().

Here is the caller graph for this function:

◆ getErrMid()

int XrdOucErrInfo::getErrMid ( )
inline

Get the monitoring identifier.

Returns
The monitoring identifier.

Definition at line 356 of file XrdOucErrInfo.hh.

356{return mID;}

References mID.

Referenced by XrdCmsResp::Alloc(), and XrdXrootdCallBack::sendError().

Here is the caller graph for this function:

◆ getErrText() [1/2]

const char * XrdOucErrInfo::getErrText ( )
inline

Get a pointer to the error text.

Returns
The pointer to the internal error text.

Definition at line 262 of file XrdOucErrInfo.hh.

263 {if (dataBuff) return dataBuff->Data();
264 return (const char *)ErrInfo.message;
265 }

References dataBuff, and ErrInfo.

Referenced by XrdSecPManager::Get(), XrdSecProtocolgsi::Init(), XrdCmsRedirLocal::Locate(), main(), XrdSecServer::PostProcess(), XrdSecTLayer::secXeq(), XrdXrootdCallBack::sendError(), and XrdXrootdAioTask::SendFSError().

Here is the caller graph for this function:

◆ getErrText() [2/2]

const char * XrdOucErrInfo::getErrText ( int & ecode)
inline

Get a pointer to the error text and the error code.

Parameters
ecode- Reference to where the error code is to be returned.
Returns
The pointer to the internal error text.

Definition at line 274 of file XrdOucErrInfo.hh.

275 {ecode = ErrInfo.code;
276 if (dataBuff) return dataBuff->Data();
277 return (const char *)ErrInfo.message;
278 }

References dataBuff, and ErrInfo.

◆ getErrTextLen()

int XrdOucErrInfo::getErrTextLen ( )
inline

Get the error text length (optimized for external buffers).

Returns
The mesage length.

Definition at line 286 of file XrdOucErrInfo.hh.

287 {if (dataBuff) return dataBuff->DataLen();
288 return strlen(ErrInfo.message);
289 }

References dataBuff, and ErrInfo.

Referenced by XrdXrootdCallBack::sendError().

Here is the caller graph for this function:

◆ getErrUser()

◆ getMsgBuff()

char * XrdOucErrInfo::getMsgBuff ( int & mblen)
inline

Get the pointer to the internal message buffer along with its size.

Parameters
mblen- Reference to where the size it to be returned.
Returns
Pointer to the internal message buffer.

Definition at line 213 of file XrdOucErrInfo.hh.

214 {mblen = sizeof(ErrInfo.message);
215 return ErrInfo.message;
216 }

References ErrInfo.

Referenced by XrdBwmHandle::Activate(), XrdOfsPrepGPIReal::PrepGPI::cancel(), XrdBwmHandle::Dispatch(), XrdOfs::Emsg(), XrdOfs::fsctl(), XrdCmsFinderTRG::Locate(), XrdOfsPrepGPIReal::PrepGPI::query(), and XrdSsiAlert::SetInfo().

Here is the caller graph for this function:

◆ getUCap()

int XrdOucErrInfo::getUCap ( )
inline

Get user capabilties.

Returns
the user capabilities.

Definition at line 389 of file XrdOucErrInfo.hh.

389{return ErrInfo.ucap;}

References ErrInfo.

Referenced by XrdOfs::fsctl(), XrdSsiSfs::fsctl(), XrdDigConfig::GetLocResp(), XrdCmsFinderRMT::Locate(), and XrdCmsRedirLocal::Locate().

Here is the caller graph for this function:

◆ operator=()

XrdOucErrInfo & XrdOucErrInfo::operator= ( const XrdOucErrInfo & rhs)
inline

Assignment operator.

Definition at line 401 of file XrdOucErrInfo.hh.

402 {ErrInfo = rhs.ErrInfo;
403 ErrCB = rhs.ErrCB;
404 ErrCBarg= rhs.ErrCBarg;
405 mID = rhs.mID;
406 dOff = -1;
407 if (rhs.dataBuff) dataBuff = rhs.dataBuff->Clone();
408 else dataBuff = 0;
409 return *this;
410 }
XrdOucBuffer * Clone(bool trim=true)

References XrdOucErrInfo(), XrdOucBuffer::Clone(), dataBuff, dOff, ErrCB, ErrInfo, and mID.

Here is the call graph for this function:

◆ Reset()

void XrdOucErrInfo::Reset ( )
inline

Reset object to no message state. Call this method to release appendages.

Definition at line 377 of file XrdOucErrInfo.hh.

378 {if (dataBuff) {dataBuff->Recycle(); dataBuff = 0;}
379 *ErrInfo.message = 0;
380 ErrInfo.code = 0;
381 }

References dataBuff, and ErrInfo.

Referenced by ~XrdOucErrInfo(), clear(), XrdOfs::Emsg(), XrdXrootdAioTask::SendFSError(), XrdXrootdCallBack::sendResp(), and XrdXrootdCallBack::sendVesp().

Here is the caller graph for this function:

◆ setEnv()

XrdOucEnv * XrdOucErrInfo::setEnv ( XrdOucEnv * newEnv)
inline

Set the error environment and return the previous environment. This call destroys any callback information that may have existed.

Parameters
newEnv- Pointer to the new error environment.
Returns
=0 - No previous envuironment existed.
!0 - Pointer to the previous error environment.

Definition at line 319 of file XrdOucErrInfo.hh.

320 {XrdOucEnv *oldEnv = (ErrCB ? 0 : ErrEnv);
321 ErrEnv = newEnv;
322 ErrCB = 0;
323 return oldEnv;
324 }

References ErrCB.

◆ setErrArg()

void XrdOucErrInfo::setErrArg ( unsigned long long cbarg = 0)
inline

Set callback argument.

Parameters
cbarg- An opaque 8-byte call-back argument.

Definition at line 116 of file XrdOucErrInfo.hh.

116{ErrCBarg = cbarg;}

◆ setErrCB()

void XrdOucErrInfo::setErrCB ( XrdOucEICB * cb,
unsigned long long cbarg = 0 )
inline

Set callback information.

Parameters
cb- Pointer to the object describing the callback.
cbarg- An opaque 8-byte call-back argument.

Definition at line 125 of file XrdOucErrInfo.hh.

126 {ErrCB = cb; ErrCBarg = cbarg;}

References ErrCB.

Referenced by XrdBwmHandle::Activate(), XrdCmsResp::Alloc(), XrdBwmHandle::Dispatch(), XrdOucCallBack::Init(), XrdOfsEvr::Wait4Event(), and XrdSsiFileReq::WantResponse().

Here is the caller graph for this function:

◆ setErrCode()

int XrdOucErrInfo::setErrCode ( int code)
inline

Set error code. Any existing error text remains intact.

Parameters
code- The error number describing the error.
Returns
code - The error number.

Definition at line 136 of file XrdOucErrInfo.hh.

136{return ErrInfo.code = code;}

References ErrInfo.

Referenced by XrdSecsssKT::XrdSecsssKT(), XrdBwmHandle::Activate(), XrdOfsPrepGPIReal::PrepGPI::cancel(), XrdOfs::chksum(), XrdBwmHandle::Dispatch(), XrdOfs::Emsg(), XrdDigFile::fctl(), XrdOfsFile::fctl(), XrdSfsNativeFile::fctl(), XrdSsiFile::fctl(), XrdOfs::fsctl(), XrdCmsFinderTRG::Locate(), XrdOfsPrepGPIReal::PrepGPI::query(), XrdSsiAlert::SetInfo(), and XrdOfsTPCJob::Sync().

Here is the caller graph for this function:

◆ setErrData()

void XrdOucErrInfo::setErrData ( const char * Data,
int Offs = 0 )
inline

Set the error tracing data (this is always placed in the internal buffer)

Parameters
Data- Pointer to the error tracing data.
Offs- Ofset into the message buffer where the data is to be set.

Definition at line 342 of file XrdOucErrInfo.hh.

343 {if (!Data) dOff = -1;
344 else {strlcpy(ErrInfo.message+Offs, Data,
345 sizeof(ErrInfo.message)-Offs);
346 dOff = Offs;
347 }
348 }
size_t strlcpy(char *dst, const char *src, size_t sz)

References dOff, ErrInfo, and strlcpy().

Referenced by XrdCmsResp::Alloc().

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

◆ setErrInfo() [1/3]

int XrdOucErrInfo::setErrInfo ( int code,
const char * emsg )
inline

Set error code and error text.

Parameters
code- The error number describing the error.
emsg- The error message text.
Returns
code - The error number.

Definition at line 147 of file XrdOucErrInfo.hh.

148 {strlcpy(ErrInfo.message, emsg, sizeof(ErrInfo.message));
149 if (dataBuff) {dataBuff->Recycle(); dataBuff = 0;}
150 return ErrInfo.code = code;
151 }
int emsg(int rc, char *msg)

References dataBuff, emsg(), ErrInfo, and strlcpy().

Referenced by XrdSecsssKT::XrdSecsssKT(), XrdBwmHandle::Activate(), XrdCmsResp::Alloc(), XrdSecProtocolunix::Authenticate(), XrdOfs::chksum(), XrdSfsFileSystem::chksum(), XrdSsiSfs::chksum(), XrdSsiSfs::chmod(), XrdCmsParser::Decode(), XrdCmsClientMan::delayResp(), XrdBwm::Emsg(), XrdBwm::Emsg(), XrdDigFS::Emsg(), XrdOfs::Emsg(), XrdSfsNative::Emsg(), XrdSsiSfs::exists(), XrdOfsTPCInfo::Fail(), XrdOfsTPC::Fatal(), XrdSecProtocolsss::Fatal(), XrdOfs::FAttr(), XrdSfsFileSystem::FAttr(), XrdBwmFile::fctl(), XrdDigFile::fctl(), XrdOfsFile::fctl(), XrdSfsNativeFile::fctl(), XrdCmsFinderRMT::Forward(), XrdOfs::FSctl(), XrdPfcFSctl::FSctl(), XrdPfcFSctl::FSctl(), XrdDigFS::fsctl(), XrdOfs::fsctl(), XrdSfsNative::fsctl(), XrdSsiSfs::fsctl(), XrdSecPManager::Get(), XrdDigConfig::GetLocResp(), XrdSecServer::getProtocol(), XrdSfsFileSystem::gpFile(), XrdCmsFinderRMT::Locate(), XrdCmsFinderTRG::Locate(), XrdCmsRedirLocal::Locate(), XrdSsiSfs::mkdir(), XrdSecServer::PostProcess(), XrdCmsFinderRMT::Prepare(), XrdOfsPrepGPIReal::PrepGPI::query(), XrdSsiSfs::rem(), XrdSsiSfs::remdir(), XrdOfs::rename(), XrdSsiSfs::rename(), XrdOucCallBack::Reply(), XrdCmsFinderRMT::Space(), XrdBwm::Stall(), XrdOfs::Stall(), XrdSsiSfs::stat(), XrdSsiSfs::stat(), XrdOfsTPCJob::Sync(), XrdSsiSfs::truncate(), XrdSecGetProtocol(), XrdSecProtocolgsiObject(), XrdSecProtocolkrb5Init(), XrdSecProtocolkrb5Object(), XrdSecProtocolpwdObject(), and XrdSecProtocolunixObject().

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

◆ setErrInfo() [2/3]

int XrdOucErrInfo::setErrInfo ( int code,
const char * txtlist[],
int n )
inline

Set error code and error text.

Parameters
code- The error number describing the error.
txtlist- A vector of error message text segments.
n- The number of valid elements in txtlist.
Returns
code - The error number.

Definition at line 163 of file XrdOucErrInfo.hh.

164 {int i, j = 0, k = sizeof(ErrInfo.message), l;
165 for (i = 0; i < n && k > 1; i++)
166 {l = strlcpy(&ErrInfo.message[j], txtlist[i], k);
167 j += l; k -= l;
168 }
169 if (dataBuff) {dataBuff->Recycle(); dataBuff = 0;}
170 return ErrInfo.code = code;
171 }

References dataBuff, ErrInfo, and strlcpy().

Here is the call graph for this function:

◆ setErrInfo() [3/3]

int XrdOucErrInfo::setErrInfo ( int code,
XrdOucBuffer * buffP )
inline

Set error code and error text.

Parameters
code- The error number describing the error.
buffP- Pointer to the data buffer holding the error text, This object takes ownership of the buffer and recycles it.
Returns
code - The error number.

Definition at line 183 of file XrdOucErrInfo.hh.

184 {if (dataBuff) dataBuff->Recycle();
185 dataBuff = buffP;
186 return ErrInfo.code = code;
187 }

References dataBuff, and ErrInfo.

◆ setErrMid()

void XrdOucErrInfo::setErrMid ( int mid)
inline

Set the monitoring identifier.

Definition at line 362 of file XrdOucErrInfo.hh.

362{mID = mid;}

References mID.

Referenced by XrdCmsResp::Alloc().

Here is the caller graph for this function:

◆ setErrUser()

void XrdOucErrInfo::setErrUser ( const char * user)
inline

Set user pointer.

Parameters
user- Pointer to a stable storage area containing the username.

Definition at line 195 of file XrdOucErrInfo.hh.

195{ErrInfo.user = (user ? user : "?");}

References ErrInfo.

Referenced by XrdCmsResp::Alloc().

Here is the caller graph for this function:

◆ setUCap()

void XrdOucErrInfo::setUCap ( int ucval)
inline

Set user capabilties.

Definition at line 395 of file XrdOucErrInfo.hh.

395{ErrInfo.ucap = ucval;}

References ErrInfo.

Member Data Documentation

◆ [union]

union { ... } XrdOucErrInfo

◆ dataBuff

◆ dOff

short XrdOucErrInfo::dOff
protected

◆ ErrCB

XrdOucEICB* XrdOucErrInfo::ErrCB
protected

◆ ErrInfo

◆ mID

int XrdOucErrInfo::mID
protected

◆ reserved

short XrdOucErrInfo::reserved
protected

Definition at line 467 of file XrdOucErrInfo.hh.

Referenced by XrdOucErrInfo(), XrdOucErrInfo(), and XrdOucErrInfo().


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