XRootD
XrdXrootdPgwBadCS Class Reference

#include <XrdXrootdPgwBadCS.hh>

+ Inheritance diagram for XrdXrootdPgwBadCS:
+ Collaboration diagram for XrdXrootdPgwBadCS:

Public Member Functions

 XrdXrootdPgwBadCS (int pid=0)
 
 ~XrdXrootdPgwBadCS ()
 
const char * boAdd (XrdXrootdFile *fP, kXR_int64 foffs, int dlen=XrdProto::kXR_pgPageSZ)
 
char * boInfo (int &boLen)
 
void boReset ()
 

Detailed Description

Definition at line 36 of file XrdXrootdPgwBadCS.hh.

Constructor & Destructor Documentation

◆ XrdXrootdPgwBadCS()

XrdXrootdPgwBadCS::XrdXrootdPgwBadCS ( int  pid = 0)
inline

Definition at line 47 of file XrdXrootdPgwBadCS.hh.

47 : boCount(0), pathID(pid) {}

◆ ~XrdXrootdPgwBadCS()

XrdXrootdPgwBadCS::~XrdXrootdPgwBadCS ( )
inline

Definition at line 48 of file XrdXrootdPgwBadCS.hh.

48 {}

Member Function Documentation

◆ boAdd()

const char * XrdXrootdPgwBadCS::boAdd ( XrdXrootdFile fP,
kXR_int64  foffs,
int  dlen = XrdProto::kXR_pgPageSZ 
)

Definition at line 58 of file XrdXrootdPgwBadCS.cc.

60 {
61 
62 // Do some tracing
63 //
64  TRACEI(PGCS, pathID <<" csErr "<<dlen<<'@'<<foffs<<" inreq="<<boCount+1
65  <<" infile=" <<fP->pgwFob->numOffs()+1<<" fn="<<fP->FileKey);
66 
67 // If this is the first offset, record the length as first and last.
68 // Othewrise just update the last length.
69 //
70  if (!boCount) cse.dlFirst = cse.dlLast = htons(dlen);
71  else cse.dlLast = htons(dlen);
72 
73 // Add offset to the vector to be returned to client for corrections.
74 //
75  if (boCount+1 >= XrdProto::kXR_pgMaxEpr)
76  return "Too many checksum errors in request";
77  badOffs[boCount++] = htonll(foffs);
78 
79 // Add offset in the set of uncorrected offsets
80 //
81  if (!fP->pgwFob->addOffs(foffs, dlen))
82  return "Too many uncorrected checksum errors in file";
83 
84 // Success!
85 //
86  return 0;
87 }
#define TRACEI(act, x)
Definition: XrdTrace.hh:66
XrdXrootdPgwFob * pgwFob
int numOffs(int *errs=0, int *fixs=0)
bool addOffs(kXR_int64 foffs, int dlen)
static const int kXR_pgMaxEpr
Definition: XProtocol.hh:497

References XrdXrootdPgwFob::addOffs(), ServerResponseBody_pgWrCSE::dlFirst, ServerResponseBody_pgWrCSE::dlLast, XrdXrootdFile::FileKey, XrdProto::kXR_pgMaxEpr, XrdXrootdPgwFob::numOffs(), XrdXrootdFile::pgwFob, and TRACEI.

+ Here is the call graph for this function:

◆ boInfo()

char * XrdXrootdPgwBadCS::boInfo ( int &  boLen)

Definition at line 93 of file XrdXrootdPgwBadCS.cc.

94 {
95  static const int crcSZ = sizeof(uint32_t);
96 
97 // If no bad offsets are present, indicate so.
98 //
99  if (!boCount)
100  {boLen = 0;
101  return 0;
102  }
103 
104 // Return the additional data
105 //
106  boLen = sizeof(cse) + (boCount * sizeof(kXR_int64));
107  cse.cseCRC = htonl(XrdOucCRC::Calc32C(((char *)&cse)+crcSZ, boLen-crcSZ));
108  return (char *)&cse;
109 }
long long kXR_int64
Definition: XPtypes.hh:98
static uint32_t Calc32C(const void *data, size_t count, uint32_t prevcs=0)
Definition: XrdOucCRC.cc:190

References XrdOucCRC::Calc32C(), and ServerResponseBody_pgWrCSE::cseCRC.

+ Here is the call graph for this function:

◆ boReset()

void XrdXrootdPgwBadCS::boReset ( )
inline

Definition at line 45 of file XrdXrootdPgwBadCS.hh.

45 {boCount = 0;}

Referenced by XrdXrootdPgwCtl::Setup().

+ Here is the caller graph for this function:

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