25 #ifndef __XRD_CL_XROOTD_MSG_HANDLER_HH__
26 #define __XRD_CL_XROOTD_MSG_HANDLER_HH__
44 class LocalFileHandler;
67 if( tostr == fromstr )
68 return "Retrying: " + tostr;
69 return "Redirected from: " + fromstr +
" to: " + tostr;
71 return "Failed at: " + fromstr +
", retrying at: " + tostr;
75 class XRootDMsgHandler;
218 std::vector<Message *>::iterator it;
237 virtual uint16_t
GetSid()
const;
259 uint32_t &bytesRead );
281 virtual bool IsRaw()
const;
294 uint32_t &bytesRead );
396 uint32_t &bytesRead );
403 uint32_t &bytesRead );
410 uint32_t &bytesRead );
577 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:558
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:523
Definition: XrdClAnyObject.hh:32
URL to
Definition: XrdClXRootDMsgHandler.hh:57
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:769
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:526
virtual bool IsRaw() const
Are we a raw writer or not?
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
Definition: XProtocol.hh:658
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
std::string GetLocation() const
Get location (protocol://host:port/path)
XRootDMsgHandler * ref
Definition: XrdClXRootDMsgHandler.hh:131
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:514
bool IsValid() const
Is the url valid.
Definition: XrdClXRootDMsgHandler.hh:80
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:375
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:547
MsgHandlerRef * pRef
Definition: XrdClXRootDMsgHandler.hh:573
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:209
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:380
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:566
URL from
Definition: XrdClXRootDMsgHandler.hh:56
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:528
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:60
XrdSysMutex mtx
Definition: XrdClXRootDMsgHandler.hh:130
void Free()
Definition: XrdClXRootDMsgHandler.hh:117
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:539
Definition: XrdClXRootDMsgHandler.hh:512
MsgHandlerRef & Self()
Definition: XrdClXRootDMsgHandler.hh:104
void UnLock()
Definition: XrdSysPthread.hh:272
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:550
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:141
Status RetryAtServer(const URL &url)
Retry the request at another server.
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:551
Status ParseResponse(AnyObject *&response)
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:91
virtual uint16_t GetSid() const
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:560
bool done
Definition: XrdClXRootDMsgHandler.hh:516
Procedure execution status.
Definition: XrdClStatus.hh:109
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:525
virtual void Process(Message *msg)
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:521
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:531
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:318
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:540
Definition: XrdSysPthread.hh:165
uint16_t count
Definition: XrdClXRootDMsgHandler.hh:132
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, SIDManager *sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:154
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:536
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:538
Definition: XrdClXRootDResponses.hh:822
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:544
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:834
virtual uint16_t Examine(Message *msg)
SIDManager * pSidMgr
Definition: XrdClXRootDMsgHandler.hh:527
Status ReadRawOther(Message *msg, int socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
virtual Status ReadMessageBody(Message *msg, int socket, uint32_t &bytesRead)
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:519
Status WriteMessageBody(int socket, uint32_t &bytesRead)
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:556
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:522
virtual uint8_t OnStreamEvent(StreamEvent event, uint16_t streamNum, Status status)
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:58
Request status.
Definition: XrdClXRootDResponses.hh:212
Handle XRootD stream IDs.
Definition: XrdClSIDManager.hh:33
Status PostProcessReadV(VectorReadInfo *vReadInfo)
Post process vector read.
Message handler.
Definition: XrdClPostMasterInterfaces.hh:68
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:563
ChunkList * GetMessageBody(uint32_t *&asyncOffset)
Definition: XrdClXRootDMsgHandler.hh:302
XRootDMsgHandler * operator->()
Definition: XrdClXRootDMsgHandler.hh:89
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:363
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:327
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:537
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:831
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:515
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:532
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:562
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
Vector read info.
Definition: XrdClXRootDResponses.hh:774
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:335
Status ReadAsync(int socket, uint32_t &btesRead)
Handle an async response.
Definition: XrdClXRootDResponses.hh:839
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:385
Definition: XrdClLocalFileHandler.hh:32
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:545
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:543
URL representation.
Definition: XrdClURL.hh:30
RedirectEntry(const URL &from, const URL &to)
Definition: XrdClXRootDMsgHandler.hh:51
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:542
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:553
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:565
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:533
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:554
void WaitDone(time_t now)
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:530
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:548
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:167
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:42
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:552
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:535
static PostMaster * GetPostMaster()
Get default post master.
MsgHandlerRef(XRootDMsgHandler *handler)
Definition: XrdClXRootDMsgHandler.hh:84
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:138
virtual void OnStatusReady(const Message *message, Status status)
The requested action has been performed and the status is available.
void HandleResponse()
Unpack the message and call the response handler.
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:534
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:524
Definition: XrdClXRootDMsgHandler.hh:49
Status pStatus
Definition: XrdClXRootDMsgHandler.hh:529
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:568
Definition: XrdSysPthread.hh:260
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
bool IsRetryable(Message *request)
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:343
void Invalidate()
Definition: XrdClXRootDMsgHandler.hh:111
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:555
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:354