Loading...
Searching...
No Matches
XrdSsiUtils Class Reference

`#include <XrdSsiUtils.hh>`

Collaboration diagram for XrdSsiUtils:

## Public Member Functions

| XrdSsiUtils ()
| ~XrdSsiUtils ()

## Static Public Member Functions

static char * | b2x (const char *ibuff, int ilen, char *obuff, int olen, char xbuff[4])
static int | Emsg (const char *pfx, int ecode, const char *op, const char *path, XrdOucErrInfo &eDest)
static int | GetErr (XrdCl::XRootDStatus &Status, std::string &eText)
static int | MapErr (int xEnum)
static void | RetErr (XrdSsiRequest &reqP, const char *eTxt, int eNum)
static void | SetErr (XrdCl::XRootDStatus &Status, XrdSsiErrInfo &eInfo)

## Detailed Description

Definition at line 40 of file XrdSsiUtils.hh.

## Constructor & Destructor Documentation

## XrdSsiUtils()

XrdSsiUtils::XrdSsiUtils | ( |  | ) |

inline

Definition at line 61 of file XrdSsiUtils.hh.

{}

## ~XrdSsiUtils()

XrdSsiUtils::~XrdSsiUtils | ( |  | ) |

inline

Definition at line 62 of file XrdSsiUtils.hh.

{}

## Member Function Documentation

## b2x()

char * XrdSsiUtils::b2x | ( | const char * | ibuff,
|  | int | ilen,
|  | char * | obuff,
|  | int | olen,
|  | char | xbuff[4] )

static

Definition at line 116 of file XrdSsiUtils.cc.

{
static const char hv[] = "0123456789abcdef";
char *oP = obuff;
// Gaurd against too short of an output buffer (minimum if 3 bytes)
//
if (olen < 3)
{*obuff = 0;
strcpy(xbuff, "...");
return obuff;
}
// Make sure we have something to format
//
if (ilen < 1)
{*obuff = 0;
*xbuff = 0;
return obuff;
}
// Do length adjustment, as needed
//
if (ilen*2 < olen) *xbuff = 0;
else {ilen = (olen-1)/2;
strcpy(xbuff, "...");
}
// Format the data. We know it will fit with a trailing null byte.
//
for (int i = 0; i < ilen; i++) {
*oP++ = hv[(ibuff[i] >> 4) & 0x0f];
*oP++ = hv[ ibuff[i] & 0x0f];
}
*oP = '\0';
return obuff;
}

## Emsg()

int XrdSsiUtils::Emsg | ( | const char * | pfx,
|  | int | ecode,
|  | const char * | op,
|  | const char * | path,
|  | XrdOucErrInfo & | eDest )

static

Definition at line 159 of file XrdSsiUtils.cc.

{
char buffer[2048];
// Get correct error code and path
//
if (ecode < 0) ecode = -ecode;
if (!path) path = "???";
// Format the error message
//
XrdOucERoute::Format(buffer, sizeof(buffer), ecode, op, path);
// Put the message in the log
//
Log.Emsg(pfx, eDest.getErrUser(), buffer);
// Place the error message in the error object and return
//
eDest.setErrInfo(ecode, buffer);
return SFS_ERROR;
}
eDest
static XrdSysError eDest(0,"crypto_")
SFS_ERROR
#define SFS_ERROR
Definition XrdSfsInterface.hh:109
XrdOucERoute::Format
static int Format(char *buff, int blen, int ecode, const char *etxt1, const char *etxt2=0)
Definition XrdOucERoute.cc:44
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95
XrdSsi::Log
XrdSysError Log
Definition XrdSsiFileReq.cc:66

References eDest, XrdOucERoute::Format(), XrdSsi::Log, and SFS_ERROR.

Referenced by XrdSsiDir::autoStat(), XrdSsiDir::close(), XrdSsiFile::fctl(), XrdSsiFileSess::fctl(), XrdSsiDir::FName(), XrdSsiDir::nextEntry(), XrdSsiDir::open(), XrdSsiFile::open(), XrdSsiFileSess::open(), XrdSsiFileSess::read(), XrdSsiFile::readv(), XrdSsiFileSess::SendData(), XrdSsiFile::sync(), XrdSsiFile::sync(), XrdSsiFileSess::truncate(), and XrdSsiFileSess::write().

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

## GetErr()

int XrdSsiUtils::GetErr | ( | XrdCl::XRootDStatus & | Status,
|  | std::string & | eText )

static

Definition at line 191 of file XrdSsiUtils.cc.

{
// If this is an xrootd error then get the xrootd generated error
//
if (Status.code == XrdCl::errErrorResponse)
{eText = Status.GetErrorMessage();
return MapErr(Status.errNo);
}
// Internal error, we will need to copy strings here
//
eText = Status.ToStr();
return (Status.errNo ? Status.errNo : EFAULT);
}
XrdCl::XRootDStatus::GetErrorMessage
const std::string & GetErrorMessage() const
Get error message.
Definition XrdClXRootDResponses.hh:242
XrdCl::XRootDStatus::ToStr
std::string ToStr() const
Convert to string.
Definition XrdClXRootDResponses.hh:258
XrdSsiUtils::MapErr
static int MapErr(int xEnum)
Definition XrdSsiUtils.cc:211
XrdCl::errErrorResponse
const uint16_t errErrorResponse
Definition XrdClStatus.hh:105
XrdCl::Status::code
uint16_t code
Error type, or additional hints on what to do.
Definition XrdClStatus.hh:147
XrdCl::Status::errNo
uint32_t errNo
Errno, if any.
Definition XrdClStatus.hh:148

References XrdCl::Status::code, XrdCl::errErrorResponse, XrdCl::Status::errNo, XrdCl::XRootDStatus::GetErrorMessage(), MapErr(), and XrdCl::XRootDStatus::ToStr().

Referenced by XrdSsiSessReal::Provision().

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

## MapErr()

int XrdSsiUtils::MapErr | ( | int | xEnum | ) |

static

Definition at line 211 of file XrdSsiUtils.cc.

{
return XProtocol::mapError(xEnum);
}
XProtocol::mapError
static int mapError(int rc)
Definition XProtocol.hh:1362

References XProtocol::mapError().

Referenced by GetErr(), and SetErr().

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

## RetErr()

void XrdSsiUtils::RetErr | ( | XrdSsiRequest & | reqP,
|  | const char * | eTxt,
|  | int | eNum )

static

Definition at line 220 of file XrdSsiUtils.cc.

{
// Schedule an error callback
//
XrdSsi::schedP->Schedule(new PostError(&reqP, strdup(eTxt), eNum));
}
XrdScheduler::Schedule
void Schedule(XrdJob *jp)
Definition XrdScheduler.cc:373
XrdSsi::schedP
XrdScheduler * schedP
Definition XrdSsiClient.cc:74

References XrdSsi::schedP.

Referenced by XrdSsiServReal::ProcessRequest(), and XrdSsiSessReal::Provision().

Here is the caller graph for this function:

## SetErr()

void XrdSsiUtils::SetErr | ( | XrdCl::XRootDStatus & | Status,
|  | XrdSsiErrInfo & | eInfo )

static

Definition at line 232 of file XrdSsiUtils.cc.

{
// If this is an xrootd error then get the xrootd generated error
//
if (Status.code == XrdCl::errErrorResponse)
{eInfo.Set(Status.GetErrorMessage().c_str(), MapErr(Status.errNo));
} else {
eInfo.Set(Status.ToStr().c_str(), (Status.errNo ? Status.errNo:EFAULT));
}
}
XrdSsiErrInfo::Set
void Set(const char *eMsg=0, int eNum=0, int eArg=0)
Definition XrdSsiErrInfo.hh:103

References XrdCl::Status::code, XrdCl::errErrorResponse, XrdCl::Status::errNo, XrdCl::XRootDStatus::GetErrorMessage(), MapErr(), XrdSsiErrInfo::Set(), and XrdCl::XRootDStatus::ToStr().

Referenced by XrdSsiTaskReal::SendRequest(), XrdSsiTaskReal::SetBuff(), XrdSsiTaskReal::SetBuff(), XrdSsiSessReal::XeqEvent(), and XrdSsiTaskReal::XeqEvent().

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

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

- XrdSsiUtils.hh
- XrdSsiUtils.cc