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;
234 virtual uint16_t
GetSid()
const;
256 uint32_t &bytesRead );
277 virtual bool IsRaw()
const;
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__ Status ParseXAttrResponse(char *data, size_t len, AnyObject *&response)
uint32_t pAsyncChunkIndex
Definition: XrdClXRootDMsgHandler.hh:592
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:608
void HandleError(XRootDStatus status, Message *msg=0)
Recover error.
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:569
Definition: XrdClAnyObject.hh:32
URL to
Definition: XrdClXRootDMsgHandler.hh:75
Status ReadRawReadV(Message *msg, Socket *socket, uint32_t &bytesRead)
Handle a kXR_readv in raw mode.
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:904
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:573
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
Definition: XProtocol.hh:609
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:560
bool RetriableErrorResponse(const Status &status)
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:368
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:597
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:193
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:373
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:616
URL from
Definition: XrdClXRootDMsgHandler.hh:74
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:575
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:589
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:79
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:74
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:587
std::string GetLocation() const
Get location (protocol://host:port/path)
Definition: XrdClXRootDMsgHandler.hh:558
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, std::shared_ptr< SIDManager > sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:123
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:600
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:110
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:601
Status ParseResponse(AnyObject *&response)
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:94
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:94
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:610
Status ReadFromBuffer(char *&buffer, size_t &buflen, T &result)
bool done
Definition: XrdClXRootDMsgHandler.hh:562
Procedure execution status.
Definition: XrdClStatus.hh:110
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:571
virtual void Process(Message *msg)
Status ReadRawRead(Message *msg, Socket *socket, uint32_t &bytesRead)
Handle a kXR_read in raw mode.
virtual void OnStatusReady(const Message *message, XRootDStatus status)
The requested action has been performed and the status is available.
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:567
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
Definition: XrdClXRootDMsgHandler.hh:63
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:578
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:302
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:588
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:574
static Log * GetLog()
Get default log.
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:584
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:586
Definition: XrdClXRootDResponses.hh:957
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:594
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:969
virtual uint16_t Examine(Message *msg)
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:580
Status ReadRawOther(Message *msg, Socket *socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:637
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:565
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
Definition: XrdSysPthread.hh:78
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:606
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:568
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:68
bool IsValid() const
Is the url valid.
XRootDStatus pStatus
Definition: XrdClXRootDMsgHandler.hh:576
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:77
Request status.
Definition: XrdClXRootDResponses.hh:214
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:572
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:71
Type type
Definition: XrdClXRootDMsgHandler.hh:76
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:613
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:356
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:636
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:311
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:585
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:966
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:561
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:579
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:612
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
Vector read info.
Definition: XrdClXRootDResponses.hh:909
Handle an async response.
Definition: XrdClXRootDResponses.hh:974
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:378
Definition: XrdClLocalFileHandler.hh:32
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:595
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:328
virtual bool IsRaw() const
Are we a raw writer or not?
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:593
URL representation.
Definition: XrdClURL.hh:30
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:591
bool OmitWait(Message *request, const URL &url)
bool pReadVRawSizeError
Definition: XrdClXRootDMsgHandler.hh:603
Status WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:615
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:581
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:604
Definition: XrdClXRootDMsgHandler.hh:62
void WaitDone(time_t now)
virtual uint8_t OnStreamEvent(StreamEvent event, XRootDStatus status)
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:577
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:598
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:168
virtual Status ReadMessageBody(Message *msg, Socket *socket, uint32_t &bytesRead)
Definition: XrdClXRootDMsgHandler.hh:65
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:47
Status ReadAsync(Socket *socket, uint32_t &btesRead)
Type
Definition: XrdClXRootDMsgHandler.hh:60
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:602
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:583
static PostMaster * GetPostMaster()
Get default post master.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:107
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:643
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:582
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:570
Definition: XrdClXRootDMsgHandler.hh:58
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:618
bool pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:628
A network socket.
Definition: XrdClSocket.hh:40
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:320
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:336
Definition: XrdClXRootDMsgHandler.hh:64
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:605
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:347