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

## Public Member Functions

| MetalinkOpenHandler (MetalinkRedirector *mr, ResponseHandler *userHandler)
virtual void | HandleResponseWithHosts (XRootDStatus *status, AnyObject *response, HostList *hostList)
Public Member Functions inherited from XrdCl::ResponseHandler
virtual | ~ResponseHandler ()
virtual void | HandleResponse (XRootDStatus *status, AnyObject *response)

## 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 156 of file XrdClMetalinkRedirector.cc.

## Constructor & Destructor Documentation

## MetalinkOpenHandler()

XrdCl::MetalinkOpenHandler::MetalinkOpenHandler | ( | MetalinkRedirector * | mr,
|  | ResponseHandler * | userHandler )

inline

Definition at line 162 of file XrdClMetalinkRedirector.cc.

:
pRedirector( mr ), pUserHandler( userHandler )
{
}

## Member Function Documentation

## HandleResponseWithHosts()

virtual void XrdCl::MetalinkOpenHandler::HandleResponseWithHosts | ( | XRootDStatus * | status,
|  | AnyObject * | response,
|  | HostList * | hostList )

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)
  hostList | list of hosts the request was redirected to

Reimplemented from XrdCl::ResponseHandler.

Definition at line 171 of file XrdClMetalinkRedirector.cc.

{
try
{
if( status->IsOK() )
{
delete status;
// download the content
MetalinkReadHandler *mrh = new MetalinkReadHandler( pRedirector,
pUserHandler );
XRootDStatus st = pRedirector->pFile->Read( 0, DefaultCPChunkSize,
mrh->GetBuffer(), mrh );
if( !st.IsOK() )
{
delete mrh;
throw new XRootDStatus( stError, errInternal );
} else
{
delete response;
delete hostList;
}
} else
throw status;
} catch( XRootDStatus *status )
{
pRedirector->FinalizeInitialization( *status );
// if we were not able to schedule a read
// pass an error to the user handler
if( pUserHandler )
pUserHandler->HandleResponseWithHosts( status, response, hostList );
else
DeallocArgs( status, response, hostList );
}
delete this;
}
XrdCl::DefaultCPChunkSize
const int DefaultCPChunkSize
Definition XrdClConstants.hh:61
XrdCl::stError
const uint16_t stError
An error occurred that could potentially be retried.
Definition XrdClStatus.hh:32
XrdCl::errInternal
const uint16_t errInternal
Internal error.
Definition XrdClStatus.hh:56
XrdCl::DeallocArgs
void DeallocArgs(XRootDStatus *status, AnyObject *response, HostList *hostList)
Definition XrdClMetalinkRedirector.cc:32

References XrdCl::DeallocArgs(), XrdCl::DefaultCPChunkSize, XrdCl::errInternal, XrdCl::MetalinkReadHandler::GetBuffer(), 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:

- XrdClMetalinkRedirector.cc