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;
204 pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
205 pResponse = reinterpret_cast<Message*>( 0xDEADBEEF );
207 pPostMaster = reinterpret_cast<PostMaster*>( 0xDEADBEEF );
208 pSidMgr = reinterpret_cast<SIDManager*>( 0xDEADBEEF );
209 pLFileHandler = reinterpret_cast<LocalFileHandler*>( 0xDEADBEEF );
210 pHosts = reinterpret_cast<HostList*>( 0xDEADBEEF );
211 pChunkList = reinterpret_cast<ChunkList*>( 0xDEADBEEF );
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__ bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:580
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:542
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:546
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
Definition: XProtocol.hh:663
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:533
bool RetriableErrorResponse(const Status &status)
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:380
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:569
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:191
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:385
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:588
URL from
Definition: XrdClXRootDMsgHandler.hh:73
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:548
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:562
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:560
std::string GetLocation() const
Get location (protocol://host:port/path)
Definition: XrdClXRootDMsgHandler.hh:531
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:572
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:109
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:573
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:582
bool done
Definition: XrdClXRootDMsgHandler.hh:535
Procedure execution status.
Definition: XrdClStatus.hh:109
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:544
virtual void Process(Message *msg)
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:540
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
Definition: XrdClXRootDMsgHandler.hh:62
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:551
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:314
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:561
static Log * GetLog()
Get default log.
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, SIDManager *sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:122
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:557
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:559
Definition: XrdClXRootDResponses.hh:837
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:566
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:553
SIDManager * pSidMgr
Definition: XrdClXRootDMsgHandler.hh:547
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:609
virtual Status ReadMessageBody(Message *msg, int socket, uint32_t &bytesRead)
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:538
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:578
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:541
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:545
Definition: XrdClAnyObject.hh:25
Handle XRootD stream IDs.
Definition: XrdClSIDManager.hh:33
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:585
ChunkList * GetMessageBody(uint32_t *&asyncOffset)
Definition: XrdClXRootDMsgHandler.hh:298
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:368
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:608
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:323
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:558
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:846
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:534
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:552
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:584
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:390
Definition: XrdClLocalFileHandler.hh:32
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:567
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:340
virtual bool IsRaw() const
Are we a raw writer or not?
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:565
URL representation.
Definition: XrdClURL.hh:30
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:564
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:575
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:587
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:554
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:576
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:550
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:570
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:574
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:556
static PostMaster * GetPostMaster()
Get default post master.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:106
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:615
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:555
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:543
Definition: XrdClXRootDMsgHandler.hh:57
Status pStatus
Definition: XrdClXRootDMsgHandler.hh:549
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:590
bool pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:600
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:332
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:348
Definition: XrdClXRootDMsgHandler.hh:63
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:577
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:359