XRootD
XrdCl::AsyncDiscardReader Class Reference

Object for discarding data. More...

#include <XrdClAsyncDiscardReader.hh>

+ Inheritance diagram for XrdCl::AsyncDiscardReader:
+ Collaboration diagram for XrdCl::AsyncDiscardReader:

Public Member Functions

 AsyncDiscardReader (const URL &url, const Message &request)
 
XRootDStatus GetResponse (AnyObject *&response)
 
XRootDStatus Read (Socket &socket, uint32_t &btsret)
 
- Public Member Functions inherited from XrdCl::AsyncRawReaderIntfc
 AsyncRawReaderIntfc (const URL &url, const Message &request)
 
virtual ~AsyncRawReaderIntfc ()
 Destructor. More...
 
void SetChunkList (ChunkList *chunks)
 Sets the chunk list with user buffers. More...
 
void SetDataLength (int dlen)
 Sets response data length. More...
 

Additional Inherited Members

- Protected Types inherited from XrdCl::AsyncRawReaderIntfc
using buffer_t = std::vector< char >
 
enum  Stage {
  ReadStart ,
  ReadRdLst ,
  ReadRaw ,
  ReadDiscard ,
  ReadDone
}
 Stages of reading out a response from the socket. More...
 
- Protected Member Functions inherited from XrdCl::AsyncRawReaderIntfc
XRootDStatus ReadBytesAsync (Socket &socket, char *buffer, uint32_t toBeRead, uint32_t &bytesRead)
 
- Protected Attributes inherited from XrdCl::AsyncRawReaderIntfc
size_t chidx
 
size_t chlen
 
size_t choff
 
std::vector< ChunkStatuschstatus
 
ChunkListchunks
 
bool dataerr
 
buffer_t discardbuff
 
uint32_t dlen
 
uint32_t msgbtsrd
 
uint32_t rawbtsrd
 
Stage readstage
 
const Messagerequest
 
const URLurl
 

Detailed Description

Object for discarding data.

Definition at line 35 of file XrdClAsyncDiscardReader.hh.

Constructor & Destructor Documentation

◆ AsyncDiscardReader()

XrdCl::AsyncDiscardReader::AsyncDiscardReader ( const URL url,
const Message request 
)
inline

Constructor

Parameters
url: channel URL
request: client request

Definition at line 44 of file XrdClAsyncDiscardReader.hh.

44  :
46  {
47  }
AsyncRawReaderIntfc(const URL &url, const Message &request)

Member Function Documentation

◆ GetResponse()

XRootDStatus XrdCl::AsyncDiscardReader::GetResponse ( AnyObject *&  response)
inlinevirtual

Get the response, since we received some unexpected data we always return an error to the end user.

Implements XrdCl::AsyncRawReaderIntfc.

Definition at line 72 of file XrdClAsyncDiscardReader.hh.

73  {
74  response = nullptr;
75  return XRootDStatus( stError, errInvalidResponse );
76  }
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
const uint16_t errInvalidResponse
Definition: XrdClStatus.hh:99

References XrdCl::errInvalidResponse, and XrdCl::stError.

◆ Read()

XRootDStatus XrdCl::AsyncDiscardReader::Read ( Socket socket,
uint32_t &  btsret 
)
inlinevirtual

Readout raw data from socket

Parameters
socket: the socket
btsret: number of bytes read
Returns
: operation status

Implements XrdCl::AsyncRawReaderIntfc.

Definition at line 56 of file XrdClAsyncDiscardReader.hh.

57  {
58  Log *log = DefaultEnv::GetLog();
59  log->Error( XRootDMsg, "[%s] Handling response to %s: "
60  "DiscardReader: we were not expecting "
61  "raw data.", url.GetHostId().c_str(),
63  // Just drop the connection, we don't know if the stream is sane anymore.
64  // Recover with a reconnect.
65  return XRootDStatus( stError, errCorruptedHeader );
66  }
static Log * GetLog()
Get default log.
const std::string & GetObfuscatedDescription() const
Get the description of the message with authz parameter obfuscated.
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:99
const uint64_t XRootDMsg
const uint16_t errCorruptedHeader
Definition: XrdClStatus.hh:103
XrdSysError Log
Definition: XrdConfig.cc:112

References XrdCl::errCorruptedHeader, XrdCl::Log::Error(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::Message::GetObfuscatedDescription(), XrdCl::AsyncRawReaderIntfc::request, XrdCl::stError, XrdCl::AsyncRawReaderIntfc::url, and XrdCl::XRootDMsg.

+ Here is the call graph for this function:

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