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;
125 std::shared_ptr<SIDManager> sidMgr,
183 log->
Debug(
ExDbgMsg,
"[%s] MsgHandler created: 0x%x (message: %s ).",
198 std::vector<Message *>::iterator it;
204 pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
205 pResponse = reinterpret_cast<Message*>( 0xDEADBEEF );
207 pPostMaster = reinterpret_cast<PostMaster*>( 0xDEADBEEF );
208 pLFileHandler = reinterpret_cast<LocalFileHandler*>( 0xDEADBEEF );
209 pHosts = reinterpret_cast<HostList*>( 0xDEADBEEF );
210 pChunkList = reinterpret_cast<ChunkList*>( 0xDEADBEEF );
232 virtual uint16_t
GetSid()
const;
254 uint32_t &bytesRead );
276 virtual bool IsRaw()
const;
289 uint32_t &bytesRead );
405 uint32_t &bytesRead );
412 uint32_t &bytesRead );
419 uint32_t &bytesRead );
596 #if __cplusplus >= 201103L 618 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__ bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:579
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:541
Definition: XrdClAnyObject.hh:32
URL to
Definition: XrdClXRootDMsgHandler.hh:74
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
virtual uint16_t GetSid() const
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:41
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:784
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:545
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
Definition: XProtocol.hh:669
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:532
bool RetriableErrorResponse(const Status &status)
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:379
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:568
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:191
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:384
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:587
URL from
Definition: XrdClXRootDMsgHandler.hh:73
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:547
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:561
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:78
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:74
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:559
std::string GetLocation() const
Get location (protocol://host:port/path)
Definition: XrdClXRootDMsgHandler.hh:530
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, std::shared_ptr< SIDManager > sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:122
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:571
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:109
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:572
Status ParseResponse(AnyObject *&response)
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:91
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:84
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:581
bool done
Definition: XrdClXRootDMsgHandler.hh:534
Procedure execution status.
Definition: XrdClStatus.hh:109
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:543
virtual void Process(Message *msg)
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:539
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
Definition: XrdClXRootDMsgHandler.hh:62
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:550
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:313
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:560
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:546
static Log * GetLog()
Get default log.
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:556
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:558
Definition: XrdClXRootDResponses.hh:837
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:565
Status ReadRawReadV(Message *msg, int socket, uint32_t &bytesRead)
Handle a kXR_readv in raw mode.
void HandleError(Status status, Message *msg=0)
Recover error.
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:849
virtual uint16_t Examine(Message *msg)
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:552
Status ReadRawOther(Message *msg, int socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:608
virtual Status ReadMessageBody(Message *msg, int socket, uint32_t &bytesRead)
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:537
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
Definition: XrdSysPthread.hh:78
Status WriteMessageBody(int socket, uint32_t &bytesRead)
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:577
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:540
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:67
bool IsValid() const
Is the url valid.
virtual uint8_t OnStreamEvent(StreamEvent event, uint16_t streamNum, Status status)
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:76
Request status.
Definition: XrdClXRootDResponses.hh:212
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:544
Definition: XrdClAnyObject.hh:25
void TakeDownTimeoutFence()
Take down the timeout fence after oksofar response has been handled.
Status PostProcessReadV(VectorReadInfo *vReadInfo)
Post process vector read.
Message handler.
Definition: XrdClPostMasterInterfaces.hh:68
Type type
Definition: XrdClXRootDMsgHandler.hh:75
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:584
ChunkList * GetMessageBody(uint32_t *&asyncOffset)
Definition: XrdClXRootDMsgHandler.hh:297
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:367
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:607
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:322
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:557
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:846
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:533
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:551
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:583
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
Vector read info.
Definition: XrdClXRootDResponses.hh:789
Status ReadAsync(int socket, uint32_t &btesRead)
Handle an async response.
Definition: XrdClXRootDResponses.hh:854
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:389
Definition: XrdClLocalFileHandler.hh:32
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:566
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:339
virtual bool IsRaw() const
Are we a raw writer or not?
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:564
URL representation.
Definition: XrdClURL.hh:30
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:563
bool OmitWait(Message *request, const URL &url)
Status ReadRawRead(Message *msg, int socket, uint32_t &bytesRead)
Handle a kXR_read in raw mode.
bool pReadVRawSizeError
Definition: XrdClXRootDMsgHandler.hh:574
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:586
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:553
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:575
Definition: XrdClXRootDMsgHandler.hh:61
void WaitDone(time_t now)
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:549
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:569
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:167
Definition: XrdClXRootDMsgHandler.hh:64
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:44
Type
Definition: XrdClXRootDMsgHandler.hh:59
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:573
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:555
static PostMaster * GetPostMaster()
Get default post master.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:106
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:614
virtual void OnStatusReady(const Message *message, Status status)
The requested action has been performed and the status is available.
bool IsRetriable(Message *request)
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
void HandleResponse()
Unpack the message and call the response handler.
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:554
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:542
Definition: XrdClXRootDMsgHandler.hh:57
Status pStatus
Definition: XrdClXRootDMsgHandler.hh:548
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:589
bool pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:599
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:331
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
Handle diagnostics.
Definition: XrdClLog.hh:101
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:347
Definition: XrdClXRootDMsgHandler.hh:63
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:576
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:358