25 #ifndef __XRD_CL_XROOTD_MSG_HANDLER_HH__ 26 #define __XRD_CL_XROOTD_MSG_HANDLER_HH__ 46 class LocalFileHandler;
69 if( tostr == fromstr )
70 return "Retrying: " + tostr;
71 return "Redirected from: " + fromstr +
" to: " + tostr;
73 return "Failed at: " + fromstr +
", retrying at: " + tostr;
147 log->
Debug(
ExDbgMsg,
"[%s] MsgHandler created: 0x%x (message: %s ).",
162 std::vector<Message *>::iterator it;
166 pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
167 pResponse = reinterpret_cast<Message*>( 0xDEADBEEF );
169 pPostMaster = reinterpret_cast<PostMaster*>( 0xDEADBEEF );
170 pSidMgr = reinterpret_cast<SIDManager*>( 0xDEADBEEF );
171 pLFileHandler = reinterpret_cast<LocalFileHandler*>( 0xDEADBEEF );
172 pHosts = reinterpret_cast<HostList*>( 0xDEADBEEF );
173 pChunkList = reinterpret_cast<ChunkList*>( 0xDEADBEEF );
194 virtual uint16_t
GetSid()
const;
216 uint32_t &bytesRead );
238 virtual bool IsRaw()
const;
251 uint32_t &bytesRead );
353 uint32_t &bytesRead );
360 uint32_t &bytesRead );
367 uint32_t &bytesRead );
529 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__ bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:515
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:480
Definition: XrdClAnyObject.hh:32
URL to
Definition: XrdClXRootDMsgHandler.hh:59
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:769
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:483
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
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:471
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:332
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:504
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:155
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:337
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:523
URL from
Definition: XrdClXRootDMsgHandler.hh:58
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:485
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:62
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:74
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:496
std::string GetLocation() const
Get location (protocol://host:port/path)
Definition: XrdClXRootDMsgHandler.hh:469
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:507
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:83
Status RetryAtServer(const URL &url)
Retry the request at another server.
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:508
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:76
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:517
bool done
Definition: XrdClXRootDMsgHandler.hh:473
Procedure execution status.
Definition: XrdClStatus.hh:109
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:482
virtual void Process(Message *msg)
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:478
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:488
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:275
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:497
static Log * GetLog()
Get default log.
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, SIDManager *sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:96
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:493
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:495
Definition: XrdClXRootDResponses.hh:822
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:501
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:484
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:476
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
Status WriteMessageBody(int socket, uint32_t &bytesRead)
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:513
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:479
bool IsValid() const
Is the url valid.
virtual uint8_t OnStreamEvent(StreamEvent event, uint16_t streamNum, Status status)
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:60
Request status.
Definition: XrdClXRootDResponses.hh:212
Definition: XrdClAnyObject.hh:25
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:520
ChunkList * GetMessageBody(uint32_t *&asyncOffset)
Definition: XrdClXRootDMsgHandler.hh:259
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:320
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:284
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:494
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:831
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:472
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:489
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:519
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
Vector read info.
Definition: XrdClXRootDResponses.hh:774
Status ReadAsync(int socket, uint32_t &btesRead)
Handle an async response.
Definition: XrdClXRootDResponses.hh:839
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:342
Definition: XrdClLocalFileHandler.hh:32
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:502
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:292
virtual bool IsRaw() const
Are we a raw writer or not?
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:500
URL representation.
Definition: XrdClURL.hh:30
RedirectEntry(const URL &from, const URL &to)
Definition: XrdClXRootDMsgHandler.hh:53
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:499
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:510
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:522
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:490
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:511
void WaitDone(time_t now)
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:487
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:505
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:167
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:42
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:509
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:492
static PostMaster * GetPostMaster()
Get default post master.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:80
virtual void OnStatusReady(const Message *message, Status status)
The requested action has been performed and the status is available.
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:491
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:481
Definition: XrdClXRootDMsgHandler.hh:51
Status pStatus
Definition: XrdClXRootDMsgHandler.hh:486
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:525
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
bool IsRetryable(Message *request)
Handle diagnostics.
Definition: XrdClLog.hh:101
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:300
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:512
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:311