XRootD
Loading...
Searching...
No Matches
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.
void SetChunkList (ChunkList *chunks)
 Sets the chunk list with user buffers.
void SetDataLength (int dlen)
 Sets response data length.

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< ChunkStatus > chstatus
ChunkList * chunks
bool dataerr
buffer_t discardbuff
uint32_t dlen
uint32_t msgbtsrd
uint32_t rawbtsrd
Stage readstage
const Message & request
const URL & url

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)

References XrdCl::AsyncRawReaderIntfc::AsyncRawReaderIntfc(), XrdCl::AsyncRawReaderIntfc::request, and XrdCl::AsyncRawReaderIntfc::url.

Referenced by XrdCl::XRootDMsgHandler::XRootDMsgHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

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;
76 }
XRootDStatus(uint16_t st=0, uint16_t code=0, uint32_t errN=0, const std::string &message="")
Constructor.
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errInvalidResponse

References XrdCl::XRootDStatus::XRootDStatus(), XrdCl::errInvalidResponse, and XrdCl::stError.

Here is the call graph for this function:

◆ 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.
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
XrdSysError Log
Definition XrdConfig.cc:113

References XrdCl::XRootDStatus::XRootDStatus(), 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: