Go to the documentation of this file.
25 #ifndef __XRD_CL_XROOTD_MSG_HANDLER_HH__
26 #define __XRD_CL_XROOTD_MSG_HANDLER_HH__
43 #if __cplusplus >= 201103L
52 class LocalFileHandler;
87 case EntryRedirect:
return "Redirected from: " + fromstr +
" to: "
91 "Falling back to virtual redirector: " + tostr;
95 case EntryWait:
return "Waited at server request. Resending: "
99 return "Failed at: " + fromstr +
", retrying at: " + tostr;
183 log->
Debug(
ExDbgMsg,
"[%s] MsgHandler created: 0x%x (message: %s ).",
198 std::vector<Message *>::iterator it;
233 virtual uint16_t
GetSid()
const;
255 uint32_t &bytesRead );
277 virtual bool IsRaw()
const;
290 uint32_t &bytesRead );
406 uint32_t &bytesRead );
413 uint32_t &bytesRead );
420 uint32_t &bytesRead );
597 #if __cplusplus >= 201103L
619 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:588
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
URL to
Definition: XrdClXRootDMsgHandler.hh:74
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:552
bool RetriableErrorResponse(const Status &status)
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:543
Handle an async response.
Definition: XrdClXRootDResponses.hh:854
SIDManager * pSidMgr
Definition: XrdClXRootDMsgHandler.hh:547
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:167
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
@ EntryRetry
Definition: XrdClXRootDMsgHandler.hh:63
Definition: XrdClLocalFileHandler.hh:32
bool IsRetriable(Message *request)
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:585
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
bool pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:600
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:74
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:564
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:78
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:584
bool OmitWait(Message *request, const URL &url)
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:577
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:615
@ EntryRedirectOnWait
Definition: XrdClXRootDMsgHandler.hh:62
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:555
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:533
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:551
Handle diagnostics.
Definition: XrdClLog.hh:101
Definition: XProtocol.hh:668
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:562
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:570
URL from
Definition: XrdClXRootDMsgHandler.hh:73
@ EntryRedirect
Definition: XrdClXRootDMsgHandler.hh:61
static Log * GetLog()
Get default log.
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:91
Status ReadRawRead(Message *msg, int socket, uint32_t &bytesRead)
Handle a kXR_read in raw mode.
virtual void Process(Message *msg)
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
Definition: XrdClXRootDMsgHandler.hh:57
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:541
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:546
Status pStatus
Definition: XrdClXRootDMsgHandler.hh:549
void HandleResponse()
Unpack the message and call the response handler.
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:84
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:590
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:567
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:332
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:359
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:559
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:587
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:608
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:540
std::string GetLocation() const
Get location (protocol://host:port/path)
bool done
Definition: XrdClXRootDMsgHandler.hh:535
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:390
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:106
Request status.
Definition: XrdClXRootDResponses.hh:212
Definition: XrdSysPthread.hh:78
Status PostProcessReadV(VectorReadInfo *vReadInfo)
Post process vector read.
@ EntryWait
Definition: XrdClXRootDMsgHandler.hh:64
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:561
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:784
virtual uint16_t Examine(Message *msg)
Status WriteMessageBody(int socket, uint32_t &bytesRead)
ChunkList * GetMessageBody(uint32_t *&asyncOffset)
Definition: XrdClXRootDMsgHandler.hh:298
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:560
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:566
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:368
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:548
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:340
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:76
void HandleError(Status status, Message *msg=0)
Recover error.
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:573
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:578
Message handler.
Definition: XrdClPostMasterInterfaces.hh:68
Status ReadAsync(int socket, uint32_t &btesRead)
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:582
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:191
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:565
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:538
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:534
bool pReadVRawSizeError
Definition: XrdClXRootDMsgHandler.hh:575
Handle XRootD stream IDs.
Definition: XrdClSIDManager.hh:33
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:67
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:557
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:574
virtual Status ReadMessageBody(Message *msg, int socket, uint32_t &bytesRead)
virtual uint16_t GetSid() const
Type type
Definition: XrdClXRootDMsgHandler.hh:75
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:572
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:323
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:846
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:553
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:554
Definition: XrdClAnyObject.hh:25
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:849
Status ParseResponse(AnyObject *&response)
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:545
Vector read info.
Definition: XrdClXRootDResponses.hh:789
static PostMaster * GetPostMaster()
Get default post master.
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:542
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:380
Status RewriteRequestRedirect(const URL &newUrl)
Type
Definition: XrdClXRootDMsgHandler.hh:59
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:348
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:544
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
Definition: XrdClXRootDResponses.hh:837
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:576
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:609
virtual void OnStatusReady(const Message *message, Status status)
The requested action has been performed and the status is available.
Procedure execution status.
Definition: XrdClStatus.hh:109
URL representation.
Definition: XrdClURL.hh:30
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:558
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:314
bool IsValid() const
Is the url valid.
Definition: XrdClXRootDMsgHandler.hh:531
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, SIDManager *sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:122
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:569
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:556
virtual bool IsRaw() const
Are we a raw writer or not?
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:41
Definition: XrdClAnyObject.hh:32
virtual uint8_t OnStreamEvent(StreamEvent event, uint16_t streamNum, Status status)
Status ReadRawOther(Message *msg, int socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
void TakeDownTimeoutFence()
Take down the timeout fence after oksofar response has been handled.
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:385
Status ReadRawReadV(Message *msg, int socket, uint32_t &bytesRead)
Handle a kXR_readv in raw mode.
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:580
void WaitDone(time_t now)
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:44
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:550
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:109