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

## Public Member Functions

| PgReadSubstitutionHandler (XrdCl::ResponseHandler *a, bool isHttps)
void | HandleResponse (XrdCl::XRootDStatus *status, XrdCl::AnyObject *rdresp)
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 ResponseHandler * | Wrap (std::function< void(XRootDStatus &, AnyObject &)> func)
static ResponseHandler * | Wrap (std::function< void(XRootDStatus *, AnyObject *)> func)

## Detailed Description

Definition at line 287 of file XrdClHttpFilePlugIn.cc.

## Constructor & Destructor Documentation

## PgReadSubstitutionHandler()

XrdCl::PgReadSubstitutionHandler::PgReadSubstitutionHandler | ( | XrdCl::ResponseHandler * | a,
|  | bool | isHttps )

inline

Definition at line 293 of file XrdClHttpFilePlugIn.cc.

: realHandler(a), isChannelEncrypted(isHttps) {}

## Member Function Documentation

## HandleResponse()

void XrdCl::PgReadSubstitutionHandler::HandleResponse | ( | XrdCl::XRootDStatus * | status,
|  | XrdCl::AnyObject * | response )

inline virtual

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

Parameters

  status | status of the request
  response | an object associated with the response (request dependent)

Reimplemented from XrdCl::ResponseHandler.

Definition at line 297 of file XrdClHttpFilePlugIn.cc.

{
if( !status->IsOK() )
{
realHandler->HandleResponse( status, rdresp );
delete this;
return;
}
//using namespace XrdCl;
ChunkInfo *chunk = 0;
rdresp->Get(chunk);
std::vector<uint32_t> cksums;
if( isChannelEncrypted )
{
size_t nbpages = chunk->length / XrdSys::PageSize;
if( chunk->length % XrdSys::PageSize )
++nbpages;
cksums.reserve( nbpages );
size_t size = chunk->length;
char *buffer = reinterpret_cast<char*>( chunk->buffer );
for( size_t pg = 0; pg < nbpages; ++pg )
{
size_t pgsize = XrdSys::PageSize;
if( pgsize > size ) pgsize = size;
uint32_t crcval = XrdOucCRC::Calc32C( buffer, pgsize );
cksums.push_back( crcval );
buffer += pgsize;
size -= pgsize;
}
}
PageInfo *pages = new PageInfo(chunk->offset, chunk->length, chunk->buffer, std::move(cksums));
delete rdresp;
AnyObject *response = new AnyObject();
response->Set( pages );
realHandler->HandleResponse( status, response );
delete this;
}
XrdOucCRC::Calc32C
static uint32_t Calc32C(const void *data, size_t count, uint32_t prevcs=0)
Definition XrdOucCRC.cc:190
XrdSys::PageSize
static const int PageSize
Definition XrdSysPageSize.hh:36
XrdCl::Status::IsOK
bool IsOK() const
We're fine.
Definition XrdClStatus.hh:124

References XrdCl::ChunkInfo::buffer, XrdOucCRC::Calc32C(), XrdCl::AnyObject::Get(), XrdCl::Status::IsOK(), XrdCl::ChunkInfo::length, XrdCl::ChunkInfo::offset, XrdSys::PageSize, and XrdCl::AnyObject::Set().

Here is the call graph for this function:

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

- XrdClHttpFilePlugIn.cc