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;
88 case EntryRedirect:
return "Redirected from: " + fromstr +
" to: "
92 "Falling back to virtual redirector: " + tostr;
96 case EntryWait:
return "Waited at server request. Resending: "
100 return "Failed at: " + fromstr +
", retrying at: " + tostr;
126 std::shared_ptr<SIDManager> sidMgr,
185 log->
Debug(
ExDbgMsg,
"[%s] MsgHandler created: 0x%x (message: %s ).",
200 std::vector<Message *>::iterator it;
256 uint32_t &bytesRead );
290 uint32_t &bytesWritten );
395 uint32_t &bytesRead );
402 uint32_t &bytesRead );
409 uint32_t &bytesRead );
553 std::string &result );
625 #if __cplusplus >= 201103L
647 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:616
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
URL to
Definition: XrdClXRootDMsgHandler.hh:75
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:579
bool RetriableErrorResponse(const Status &status)
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:570
A network socket.
Definition: XrdClSocket.hh:41
Handle an async response.
Definition: XrdClXRootDResponses.hh:975
Status ReadRawRead(Message *msg, Socket *socket, uint32_t &bytesRead)
Handle a kXR_read in raw mode.
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
Status ReadRawReadV(Message *msg, Socket *socket, uint32_t &bytesRead)
Handle a kXR_readv in raw mode.
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:169
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
@ EntryRetry
Definition: XrdClXRootDMsgHandler.hh:64
Definition: XrdClLocalFileHandler.hh:33
bool IsRetriable(Message *request)
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:613
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
bool pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:628
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:74
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:591
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:79
Status WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:612
bool OmitWait(Message *request, const URL &url)
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:605
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:643
@ EntryRedirectOnWait
Definition: XrdClXRootDMsgHandler.hh:63
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:582
virtual uint8_t OnStreamEvent(StreamEvent event, XRootDStatus status)
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:560
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:578
Handle diagnostics.
Definition: XrdClLog.hh:102
Definition: XProtocol.hh:609
Status ParseXAttrResponse(char *data, size_t len, AnyObject *&response)
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:589
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:598
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, std::shared_ptr< SIDManager > sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:123
URL from
Definition: XrdClXRootDMsgHandler.hh:74
@ EntryRedirect
Definition: XrdClXRootDMsgHandler.hh:62
static Log * GetLog()
Get default log.
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:95
virtual void Process(Message *msg)
The message representation used throughout the system.
Definition: XrdClMessage.hh:30
Definition: XrdClXRootDMsgHandler.hh:59
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:568
Status ReadFromBuffer(char *&buffer, size_t &buflen, size_t size, std::string &result)
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:573
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:94
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:618
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:595
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:320
Status ReadFromBuffer(char *&buffer, size_t &buflen, T &result)
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:347
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:586
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:615
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:636
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:567
std::string GetLocation() const
Get location (protocol://host:port/path)
bool done
Definition: XrdClXRootDMsgHandler.hh:562
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:378
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:109
Request status.
Definition: XrdClXRootDResponses.hh:215
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:574
Definition: XrdSysPthread.hh:79
Status PostProcessReadV(VectorReadInfo *vReadInfo)
Post process vector read.
@ EntryWait
Definition: XrdClXRootDMsgHandler.hh:65
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:588
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:904
virtual uint16_t Examine(Message *msg)
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:587
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:594
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:356
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:575
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:328
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:77
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:601
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:606
Message handler.
Definition: XrdClPostMasterInterfaces.hh:72
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:610
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:193
void HandleError(XRootDStatus status, Message *msg=0)
Recover error.
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:593
uint32_t pAsyncChunkIndex
Definition: XrdClXRootDMsgHandler.hh:592
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:565
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:561
bool pReadVRawSizeError
Definition: XrdClXRootDMsgHandler.hh:603
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:68
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:584
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:602
XRootDStatus pStatus
Definition: XrdClXRootDMsgHandler.hh:576
virtual uint16_t GetSid() const
virtual Status ReadMessageBody(Message *msg, Socket *socket, uint32_t &bytesRead)
Type type
Definition: XrdClXRootDMsgHandler.hh:76
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:600
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:311
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:966
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:580
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:581
Definition: XrdClAnyObject.hh:26
Status ReadRawOther(Message *msg, Socket *socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:969
Status ParseResponse(AnyObject *&response)
virtual void OnStatusReady(const Message *message, XRootDStatus status)
The requested action has been performed and the status is available.
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:572
Vector read info.
Definition: XrdClXRootDResponses.hh:910
static PostMaster * GetPostMaster()
Get default post master.
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:569
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:368
Status RewriteRequestRedirect(const URL &newUrl)
Type
Definition: XrdClXRootDMsgHandler.hh:61
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:336
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:571
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
Definition: XrdClXRootDResponses.hh:958
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:604
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:637
Procedure execution status.
Definition: XrdClStatus.hh:111
URL representation.
Definition: XrdClURL.hh:31
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:585
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:302
bool IsValid() const
Is the url valid.
Definition: XrdClXRootDMsgHandler.hh:559
Status ReadFromBuffer(char *&buffer, size_t &buflen, std::string &result)
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:597
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:583
virtual bool IsRaw() const
Are we a raw writer or not?
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:41
Definition: XrdClAnyObject.hh:33
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:373
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:608
void WaitDone(time_t now)
Status ReadAsync(Socket *socket, uint32_t &btesRead)
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:48
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:577
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:110