19 #ifndef SRC_XRDCL_XRDCLASYNCVECTORREADER_HH_
20 #define SRC_XRDCL_XRDCLASYNCVECTORREADER_HH_
87 log->
Error(
XRootDMsg,
"[%s] VectorReader: No enough data to read "
88 "another chunk header. Discarding %d bytes.",
98 char *buff =
reinterpret_cast<char*
>( &rdlst );
119 bool chfound =
false;
120 for(
size_t i = 0; i <
chunks->size(); ++i )
122 if( ( *
chunks )[i].offset == uint64_t( rdlst.
offset ) &&
123 ( *
chunks )[i].length == uint32_t( rdlst.
rlen ) )
137 log->
Error(
XRootDMsg,
"[%s] VectorReader: Impossible to find chunk "
138 "buffer corresponding to %d bytes at %lld",
160 log->
Error(
XRootDMsg,
"[%s] VectorReader: Malformed chunk header: "
161 "reading %d bytes from message would cross the message "
162 "boundary, discarding %d bytes.",
url.
GetHostId().c_str(),
163 rdlst.
rlen, btsleft );
173 char *buff =
static_cast<char*
>( ( *chunks )[
chidx].buffer );
184 log->
Dump(
XRootDMsg,
"[%s] VectorReader: read buffer for chunk %d@%lld",
255 for( uint32_t i = 0; i <
chunks->size(); ++i )
259 ptr->GetChunks().emplace_back( ( *
chunks )[i].offset,
264 response->
Set( ptr.release() );
void Set(Type object, bool own=true)
Base class for any message's body reader.
std::vector< ChunkStatus > chstatus
XRootDStatus ReadBytesAsync(Socket &socket, char *buffer, uint32_t toBeRead, uint32_t &bytesRead)
Object for reading out data from the VectorRead response.
AsyncVectorReader(const URL &url, const Message &request)
XRootDStatus Read(Socket &socket, uint32_t &btsret)
XRootDStatus GetResponse(AnyObject *&response)
Get the response.
static Log * GetLog()
Get default log.
void Error(uint64_t topic, const char *format,...)
Report an error.
void Dump(uint64_t topic, const char *format,...)
Print a dump message.
The message representation used throughout the system.
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
const uint16_t stFatal
Fatal error, it's still an error.
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errInternal
Internal error.
const uint16_t errInvalidResponse
const uint16_t errCorruptedHeader
Procedure execution status.
uint16_t code
Error type, or additional hints on what to do.
bool IsOK() const
We're fine.