XRootD
Loading...
Searching...
No Matches
XrdCl::ChunkHandler Class Reference
Inheritance diagram for XrdCl::ChunkHandler:
Collaboration diagram for XrdCl::ChunkHandler:

Public Member Functions

 ChunkHandler (XCpSrc *src, uint64_t offset, uint64_t size, char *buffer, File *handle, bool usepgrd)
virtual ~ChunkHandler ()
virtual void HandleResponse (XRootDStatus *status, AnyObject *response)
Public Member Functions inherited from XrdCl::ResponseHandler
virtual ~ResponseHandler ()
virtual void HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)

Additional Inherited Members

Static Public Member Functions inherited from XrdCl::ResponseHandler
static ResponseHandlerWrap (std::function< void(XRootDStatus &, AnyObject &)> func)
static ResponseHandlerWrap (std::function< void(XRootDStatus *, AnyObject *)> func)

Detailed Description

Definition at line 38 of file XrdClXCpSrc.cc.

Constructor & Destructor Documentation

◆ ChunkHandler()

XrdCl::ChunkHandler::ChunkHandler ( XCpSrc * src,
uint64_t offset,
uint64_t size,
char * buffer,
File * handle,
bool usepgrd )
inline

Definition at line 42 of file XrdClXCpSrc.cc.

42 :
43 pSrc( src->Self() ), pOffset( offset ), pSize( size ), pBuffer( buffer ), pHandle( handle ), pUsePgRead( usepgrd )
44 {
45
46 }

◆ ~ChunkHandler()

virtual XrdCl::ChunkHandler::~ChunkHandler ( )
inlinevirtual

Definition at line 48 of file XrdClXCpSrc.cc.

49 {
50 pSrc->Delete();
51 }

Member Function Documentation

◆ HandleResponse()

virtual void XrdCl::ChunkHandler::HandleResponse ( XRootDStatus * status,
AnyObject * response )
inlinevirtual

Called when a response to associated request arrives or an error occurs

Parameters
statusstatus of the request
responsean object associated with the response (request dependent)

Reimplemented from XrdCl::ResponseHandler.

Definition at line 53 of file XrdClXCpSrc.cc.

54 {
55 PageInfo *chunk = 0;
56 if( response ) // get the response
57 {
58 ToPgInfo( response, chunk );
59 delete response;
60 }
61
62 if( !chunk && status->IsOK() ) // if the response is not there make sure the status is error
63 {
64 *status = XRootDStatus( stError, errInternal );
65 }
66
67 if( status->IsOK() && chunk->GetLength() != pSize ) // the file size on the server is different
68 { // than the one specified in metalink file
69 *status = XRootDStatus( stError, errDataError );
70 }
71
72 if( !status->IsOK() )
73 {
74 delete[] pBuffer;
75 delete chunk;
76 chunk = 0;
77 }
78
79 pSrc->ReportResponse( status, chunk, pHandle );
80
81 delete this;
82 }
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errDataError
data is corrupted
const uint16_t errInternal
Internal error.

References XrdCl::errDataError, XrdCl::errInternal, XrdCl::PageInfo::GetLength(), XrdCl::Status::IsOK(), and XrdCl::stError.

Here is the call graph for this function:

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