xrootd
XrdClXRootDMsgHandler.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2014 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // This file is part of the XRootD software suite.
6 //
7 // XRootD is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // XRootD is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // In applying this licence, CERN does not waive the privileges and immunities
21 // granted to it by virtue of its status as an Intergovernmental Organization
22 // or submit itself to any jurisdiction.
23 //------------------------------------------------------------------------------
24 
25 #ifndef __XRD_CL_XROOTD_MSG_HANDLER_HH__
26 #define __XRD_CL_XROOTD_MSG_HANDLER_HH__
27 
30 #include "XrdCl/XrdClDefaultEnv.hh"
31 #include "XrdCl/XrdClMessage.hh"
32 #include "XProtocol/XProtocol.hh"
33 #include "XrdCl/XrdClLog.hh"
34 #include "XrdCl/XrdClConstants.hh"
35 
36 #include "XrdSys/XrdSysPthread.hh"
37 
38 #include <sys/uio.h>
39 
40 #include <list>
41 #include <memory>
42 
43 #if __cplusplus >= 201103L
44 #include <atomic>
45 #endif
46 
47 namespace XrdCl
48 {
49  class PostMaster;
50  class SIDManager;
51  class URL;
52  class LocalFileHandler;
53 
54  //----------------------------------------------------------------------------
55  // Single entry in the redirect-trace-back
56  //----------------------------------------------------------------------------
58  {
59  enum Type
60  {
65  };
66 
67  RedirectEntry( const URL &from, const URL &to, Type type ) :
68  from( from ), to( to ), type( type )
69  {
70 
71  }
72 
77 
78  std::string ToString( bool prevok = true )
79  {
80  const std::string tostr = to.GetLocation();
81  const std::string fromstr = from.GetLocation();
82 
83  if( prevok )
84  {
85  switch( type )
86  {
87  case EntryRedirect: return "Redirected from: " + fromstr + " to: "
88  + tostr;
89 
90  case EntryRedirectOnWait: return "Server responded with wait. "
91  "Falling back to virtual redirector: " + tostr;
92 
93  case EntryRetry: return "Retrying: " + tostr;
94 
95  case EntryWait: return "Waited at server request. Resending: "
96  + tostr;
97  }
98  }
99  return "Failed at: " + fromstr + ", retrying at: " + tostr;
100  }
101  };
102 
103  //----------------------------------------------------------------------------
105  //----------------------------------------------------------------------------
107  public OutgoingMsgHandler
108  {
109  friend class HandleRspJob;
110 
111  public:
112  //------------------------------------------------------------------------
121  //------------------------------------------------------------------------
123  ResponseHandler *respHandler,
124  const URL *url,
125  SIDManager *sidMgr,
126  LocalFileHandler *lFileHandler):
127  pRequest( msg ),
128  pResponse( 0 ),
129  pResponseHandler( respHandler ),
130  pUrl( *url ),
132  pSidMgr( sidMgr ),
133  pLFileHandler( lFileHandler ),
134  pExpiration( 0 ),
135  pRedirectAsAnswer( false ),
136  pOksofarAsAnswer( false ),
137  pHosts( 0 ),
138  pHasLoadBalancer( false ),
139  pHasSessionId( false ),
140  pChunkList( 0 ),
141  pRedirectCounter( 0 ),
143 
144  pAsyncOffset( 0 ),
145  pAsyncReadSize( 0 ),
146  pAsyncReadBuffer( 0 ),
147  pAsyncMsgSize( 0 ),
148 
149  pReadRawStarted( false ),
151 
152  pReadVRawMsgOffset( 0 ),
153  pReadVRawChunkHeaderDone( false ),
155  pReadVRawSizeError( false ),
156  pReadVRawChunkIndex( 0 ),
157  pReadVRawMsgDiscard( false ),
158 
159  pOtherRawStarted( false ),
160 
161  pFollowMetalink( false ),
162 
163  pStateful( false ),
164 
165  pAggregatedWaitTime( 0 ),
166 
167  pMsgInFly( false ),
168 
169  pTimeoutFence( false ),
170 
171  pDirListStarted( false ),
172  pDirListWithStat( false ),
173 
174  pCV( 0 )
175 
176  {
178  if( msg->GetSessionId() )
179  pHasSessionId = true;
180  memset( &pReadVRawChunkHeader, 0, sizeof( readahead_list ) );
181 
182  Log *log = DefaultEnv::GetLog();
183  log->Debug( ExDbgMsg, "[%s] MsgHandler created: 0x%x (message: %s ).",
184  pUrl.GetHostId().c_str(), this,
185  pRequest->GetDescription().c_str() );
186  }
187 
188  //------------------------------------------------------------------------
190  //------------------------------------------------------------------------
192  {
194 
195  if( !pHasSessionId )
196  delete pRequest;
197  delete pResponse;
198  std::vector<Message *>::iterator it;
199  for( it = pPartialResps.begin(); it != pPartialResps.end(); ++it )
200  delete *it;
201 
203 
204  pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
205  pResponse = reinterpret_cast<Message*>( 0xDEADBEEF );
206  pResponseHandler = reinterpret_cast<ResponseHandler*>( 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 );
212  pEffectiveDataServerUrl = reinterpret_cast<URL*>( 0xDEADBEEF );
213 
214  Log *log = DefaultEnv::GetLog();
215  log->Debug( ExDbgMsg, "[%s] Destroying MsgHandler: 0x%x.",
216  pUrl.GetHostId().c_str(), this );
217  }
218 
219  //------------------------------------------------------------------------
225  //------------------------------------------------------------------------
226  virtual uint16_t Examine( Message *msg );
227 
228  //------------------------------------------------------------------------
232  //------------------------------------------------------------------------
233  virtual uint16_t GetSid() const;
234 
235  //------------------------------------------------------------------------
239  //------------------------------------------------------------------------
240  virtual void Process( Message *msg );
241 
242  //------------------------------------------------------------------------
252  //------------------------------------------------------------------------
253  virtual Status ReadMessageBody( Message *msg,
254  int socket,
255  uint32_t &bytesRead );
256 
257  //------------------------------------------------------------------------
263  //------------------------------------------------------------------------
264  virtual uint8_t OnStreamEvent( StreamEvent event,
265  uint16_t streamNum,
266  Status status );
267 
268  //------------------------------------------------------------------------
270  //------------------------------------------------------------------------
271  virtual void OnStatusReady( const Message *message,
272  Status status );
273 
274  //------------------------------------------------------------------------
276  //------------------------------------------------------------------------
277  virtual bool IsRaw() const;
278 
279  //------------------------------------------------------------------------
288  //------------------------------------------------------------------------
289  Status WriteMessageBody( int socket,
290  uint32_t &bytesRead );
291 
292  //------------------------------------------------------------------------
297  //------------------------------------------------------------------------
298  ChunkList* GetMessageBody( uint32_t *&asyncOffset )
299  {
300  asyncOffset = &pAsyncOffset;
301  return pChunkList;
302  }
303 
304  //------------------------------------------------------------------------
308  //------------------------------------------------------------------------
309  void WaitDone( time_t now );
310 
311  //------------------------------------------------------------------------
313  //------------------------------------------------------------------------
314  void SetExpiration( time_t expiration )
315  {
316  pExpiration = expiration;
317  }
318 
319  //------------------------------------------------------------------------
322  //------------------------------------------------------------------------
323  void SetRedirectAsAnswer( bool redirectAsAnswer )
324  {
325  pRedirectAsAnswer = redirectAsAnswer;
326  }
327 
328  //------------------------------------------------------------------------
331  //------------------------------------------------------------------------
332  void SetOksofarAsAnswer( bool oksofarAsAnswer )
333  {
334  pOksofarAsAnswer = oksofarAsAnswer;
335  }
336 
337  //------------------------------------------------------------------------
339  //------------------------------------------------------------------------
340  const Message *GetRequest() const
341  {
342  return pRequest;
343  }
344 
345  //------------------------------------------------------------------------
347  //------------------------------------------------------------------------
348  void SetLoadBalancer( const HostInfo &loadBalancer )
349  {
350  if( !loadBalancer.url.IsValid() )
351  return;
352  pLoadBalancer = loadBalancer;
353  pHasLoadBalancer = true;
354  }
355 
356  //------------------------------------------------------------------------
358  //------------------------------------------------------------------------
359  void SetHostList( HostList *hostList )
360  {
361  delete pHosts;
362  pHosts = hostList;
363  }
364 
365  //------------------------------------------------------------------------
367  //------------------------------------------------------------------------
368  void SetChunkList( ChunkList *chunkList )
369  {
370  pChunkList = chunkList;
371  if( chunkList )
372  pChunkStatus.resize( chunkList->size() );
373  else
374  pChunkStatus.clear();
375  }
376 
377  //------------------------------------------------------------------------
379  //------------------------------------------------------------------------
380  void SetRedirectCounter( uint16_t redirectCounter )
381  {
382  pRedirectCounter = redirectCounter;
383  }
384 
385  void SetFollowMetalink( bool followMetalink )
386  {
387  pFollowMetalink = followMetalink;
388  }
389 
390  void SetStateful( bool stateful )
391  {
392  pStateful = stateful;
393  }
394 
395  //------------------------------------------------------------------------
397  //------------------------------------------------------------------------
398  void TakeDownTimeoutFence();
399 
400  private:
401  //------------------------------------------------------------------------
403  //------------------------------------------------------------------------
404  Status ReadRawRead( Message *msg,
405  int socket,
406  uint32_t &bytesRead );
407 
408  //------------------------------------------------------------------------
410  //------------------------------------------------------------------------
412  int socket,
413  uint32_t &bytesRead );
414 
415  //------------------------------------------------------------------------
417  //------------------------------------------------------------------------
419  int socket,
420  uint32_t &bytesRead );
421 
422  //------------------------------------------------------------------------
425  //------------------------------------------------------------------------
426  Status ReadAsync( int socket, uint32_t &btesRead );
427 
428  //------------------------------------------------------------------------
430  //------------------------------------------------------------------------
431  void HandleError( Status status, Message *msg = 0 );
432 
433  //------------------------------------------------------------------------
435  //------------------------------------------------------------------------
436  Status RetryAtServer( const URL &url, RedirectEntry::Type entryType );
437 
438  //------------------------------------------------------------------------
440  //------------------------------------------------------------------------
441  void HandleResponse();
442 
443  //------------------------------------------------------------------------
445  //------------------------------------------------------------------------
447 
448  //------------------------------------------------------------------------
451  //------------------------------------------------------------------------
452  Status ParseResponse( AnyObject *&response );
453 
454  //------------------------------------------------------------------------
457  //------------------------------------------------------------------------
458  Status RewriteRequestRedirect( const URL &newUrl );
459 
460  //------------------------------------------------------------------------
462  //------------------------------------------------------------------------
464 
465  //------------------------------------------------------------------------
467  //------------------------------------------------------------------------
468  Status PostProcessReadV( VectorReadInfo *vReadInfo );
469 
470  //------------------------------------------------------------------------
472  //------------------------------------------------------------------------
474 
475  //------------------------------------------------------------------------
477  //------------------------------------------------------------------------
478  void UpdateTriedCGI(uint32_t errNo=0);
479 
480  //------------------------------------------------------------------------
482  //------------------------------------------------------------------------
483  void SwitchOnRefreshFlag();
484 
485  //------------------------------------------------------------------------
488  //------------------------------------------------------------------------
489  void HandleRspOrQueue();
490 
491  //------------------------------------------------------------------------
493  //------------------------------------------------------------------------
494  void HandleLocalRedirect( URL *url );
495 
496  //------------------------------------------------------------------------
501  //------------------------------------------------------------------------
502  bool IsRetriable( Message *request );
503 
504  //------------------------------------------------------------------------
511  //------------------------------------------------------------------------
512  bool OmitWait( Message *request, const URL &url );
513 
514  //------------------------------------------------------------------------
520  //------------------------------------------------------------------------
521  bool RetriableErrorResponse( const Status &status );
522 
523  //------------------------------------------------------------------------
525  //------------------------------------------------------------------------
526  void DumpRedirectTraceBack();
527 
528  //------------------------------------------------------------------------
529  // Helper struct for async reading of chunks
530  //------------------------------------------------------------------------
531  struct ChunkStatus
532  {
533  ChunkStatus(): sizeError( false ), done( false ) {}
534  bool sizeError;
535  bool done;
536  };
537 
538  typedef std::list<std::unique_ptr<RedirectEntry>> RedirectTraceBack;
539 
542  std::vector<Message *> pPartialResps;
551  time_t pExpiration;
558  std::string pRedirectUrl;
560  std::vector<ChunkStatus> pChunkStatus;
563 
564  uint32_t pAsyncOffset;
565  uint32_t pAsyncReadSize;
567  uint32_t pAsyncMsgSize;
568 
571 
579 
581 
583 
584  bool pStateful;
586 
587  std::unique_ptr<RedirectEntry> pRdirEntry;
589 
590  bool pMsgInFly;
591 
592  //------------------------------------------------------------------------
593  // true if MsgHandler is both in inQueue and installed in respective
594  // Stream (this could happen if server gave oksofar response), otherwise
595  // false
596  //------------------------------------------------------------------------
597 #if __cplusplus >= 201103L
598  std::atomic<bool> pTimeoutFence;
599 #else
601 #endif
602 
603  //------------------------------------------------------------------------
604  // if we are serving chunked data to the user's handler in case of
605  // kXR_dirlist we need to memorize if the response contains stat info or
606  // not (the information is only encoded in the first chunk)
607  //------------------------------------------------------------------------
610 
611  //------------------------------------------------------------------------
612  // synchronization is needed in case the MsgHandler has been configured
613  // to serve kXR_oksofar as a response to the user's handler
614  //------------------------------------------------------------------------
616  };
617 }
618 
619 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
XrdCl::XRootDMsgHandler::pRedirectTraceBack
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:588
XrdCl::XRootDMsgHandler::DumpRedirectTraceBack
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
XrdClConstants.hh
XrdCl::RedirectEntry::to
URL to
Definition: XrdClXRootDMsgHandler.hh:74
XrdCl::XRootDMsgHandler::pRedirectAsAnswer
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:552
XrdCl::XRootDMsgHandler::RetriableErrorResponse
bool RetriableErrorResponse(const Status &status)
XrdClXRootDResponses.hh
XrdCl::XRootDMsgHandler::pResponseHandler
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:543
XrdCl::ResponseHandler
Handle an async response.
Definition: XrdClXRootDResponses.hh:854
XrdCl::XRootDMsgHandler::pSidMgr
SIDManager * pSidMgr
Definition: XrdClXRootDMsgHandler.hh:547
XrdCl::Log::Debug
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
XrdCl::OutgoingMsgHandler
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:167
XrdCl::XRootDMsgHandler::UpdateTriedCGI
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
XrdCl::RedirectEntry::EntryRetry
Definition: XrdClXRootDMsgHandler.hh:63
XrdCl::XRootDMsgHandler::HandleRspOrQueue
void HandleRspOrQueue()
XrdClPostMasterInterfaces.hh
XrdCl::LocalFileHandler
Definition: XrdClLocalFileHandler.hh:32
XrdCl::XRootDMsgHandler::IsRetriable
bool IsRetriable(Message *request)
XrdCl::XRootDMsgHandler::pAggregatedWaitTime
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:585
XrdCl::XRootDMsgHandler::RewriteRequestWait
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
XrdSysPthread.hh
XrdCl::XRootDMsgHandler::pTimeoutFence
bool pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:600
XrdCl::Message::GetDescription
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:74
XrdCl::XRootDMsgHandler::pAsyncOffset
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:564
XrdCl::RedirectEntry::ToString
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:78
XrdClMessage.hh
XrdCl::XRootDMsgHandler::pStateful
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:584
XrdCl::XRootDMsgHandler::OmitWait
bool OmitWait(Message *request, const URL &url)
XrdCl::XRootDMsgHandler::pReadVRawChunkHeader
readahead_list pReadVRawChunkHeader
Definition: XrdClXRootDMsgHandler.hh:577
XrdCl::XRootDMsgHandler::pCV
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:615
XrdCl::RedirectEntry::EntryRedirectOnWait
Definition: XrdClXRootDMsgHandler.hh:62
XrdCl::XRootDMsgHandler::pHasLoadBalancer
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:555
XrdCl::XRootDMsgHandler::UnPackReadVResponse
Status UnPackReadVResponse(Message *msg)
Unpack a single readv response.
XrdCl::XRootDMsgHandler::ChunkStatus::ChunkStatus
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:533
XrdCl::XRootDMsgHandler::pExpiration
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:551
XrdCl::Log
Handle diagnostics.
Definition: XrdClLog.hh:101
readahead_list
Definition: XProtocol.hh:663
XrdCl::XRootDMsgHandler::pNotAuthorizedCounter
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:562
XrdCl::XRootDMsgHandler::pReadRawCurrentOffset
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:570
XrdCl::RedirectEntry::from
URL from
Definition: XrdClXRootDMsgHandler.hh:73
XrdCl::RedirectEntry::EntryRedirect
Definition: XrdClXRootDMsgHandler.hh:61
XrdCl::DefaultEnv::GetLog
static Log * GetLog()
Get default log.
XrdCl::IncomingMsgHandler::StreamEvent
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:91
XrdCl::XRootDMsgHandler::ReadRawRead
Status ReadRawRead(Message *msg, int socket, uint32_t &bytesRead)
Handle a kXR_read in raw mode.
XrdCl::XRootDMsgHandler::Process
virtual void Process(Message *msg)
XrdCl::Message
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
XrdCl::RedirectEntry
Definition: XrdClXRootDMsgHandler.hh:57
XrdCl::XRootDMsgHandler::pResponse
Message * pResponse
Definition: XrdClXRootDMsgHandler.hh:541
XrdCl::XRootDMsgHandler::pPostMaster
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:546
XProtocol.hh
XrdCl::XRootDMsgHandler::pStatus
Status pStatus
Definition: XrdClXRootDMsgHandler.hh:549
XrdCl::XRootDMsgHandler::HandleResponse
void HandleResponse()
Unpack the message and call the response handler.
XrdCl::URL::GetHostId
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:84
XrdCl::XRootDMsgHandler::pMsgInFly
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:590
XrdCl::Message::GetSessionId
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:90
XrdCl::XRootDMsgHandler::pAsyncMsgSize
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:567
XrdCl::XRootDMsgHandler::SetOksofarAsAnswer
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:332
XrdClLog.hh
XrdCl::XRootDMsgHandler::SetHostList
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:359
XrdCl::XRootDMsgHandler::pChunkList
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:559
XrdCl::XRootDMsgHandler::pRdirEntry
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:587
XrdCl::XRootDMsgHandler::pDirListStarted
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:608
XrdCl::XRootDMsgHandler::pRequest
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:540
XrdCl::URL::GetLocation
std::string GetLocation() const
Get location (protocol://host:port/path)
XrdCl::XRootDMsgHandler::ChunkStatus::done
bool done
Definition: XrdClXRootDMsgHandler.hh:535
XrdCl::XRootDMsgHandler::SetStateful
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:390
XrdCl::XRootDMsgHandler
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:106
XrdCl::XRootDStatus
Request status.
Definition: XrdClXRootDResponses.hh:212
XrdSysCondVar
Definition: XrdSysPthread.hh:78
XrdCl::XRootDMsgHandler::PostProcessReadV
Status PostProcessReadV(VectorReadInfo *vReadInfo)
Post process vector read.
XrdCl::RedirectEntry::EntryWait
Definition: XrdClXRootDMsgHandler.hh:64
XrdCl::XRootDMsgHandler::pRedirectCounter
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:561
XrdCl::ChunkList
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:784
XrdCl::XRootDMsgHandler::Examine
virtual uint16_t Examine(Message *msg)
XrdCl::XRootDMsgHandler::WriteMessageBody
Status WriteMessageBody(int socket, uint32_t &bytesRead)
XrdCl::XRootDMsgHandler::GetMessageBody
ChunkList * GetMessageBody(uint32_t *&asyncOffset)
Definition: XrdClXRootDMsgHandler.hh:298
XrdCl::XRootDMsgHandler::pChunkStatus
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:560
XrdCl::XRootDMsgHandler::pAsyncReadBuffer
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:566
XrdCl::XRootDMsgHandler::SetChunkList
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:368
XrdCl::XRootDMsgHandler::pLFileHandler
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:548
XrdCl::XRootDMsgHandler::GetRequest
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:340
XrdCl::RedirectEntry::status
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:76
XrdCl::XRootDMsgHandler::HandleError
void HandleError(Status status, Message *msg=0)
Recover error.
XrdCl::XRootDMsgHandler::pReadVRawChunkHeaderDone
bool pReadVRawChunkHeaderDone
Definition: XrdClXRootDMsgHandler.hh:573
XrdCl::XRootDMsgHandler::pReadVRawMsgDiscard
bool pReadVRawMsgDiscard
Definition: XrdClXRootDMsgHandler.hh:578
XrdCl::IncomingMsgHandler
Message handler.
Definition: XrdClPostMasterInterfaces.hh:68
XrdCl::XRootDMsgHandler::ReadAsync
Status ReadAsync(int socket, uint32_t &btesRead)
XrdCl::XRootDMsgHandler::pFollowMetalink
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:582
XrdCl::XRootDMsgHandler::~XRootDMsgHandler
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:191
XrdCl::XRootDMsgHandler::pAsyncReadSize
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:565
XrdCl::XRootDMsgHandler::RedirectTraceBack
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:538
XrdCl::XRootDMsgHandler::ChunkStatus::sizeError
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:534
XrdCl::XRootDMsgHandler::pReadVRawSizeError
bool pReadVRawSizeError
Definition: XrdClXRootDMsgHandler.hh:575
XrdCl::SIDManager
Handle XRootD stream IDs.
Definition: XrdClSIDManager.hh:33
XrdCl::RedirectEntry::RedirectEntry
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:67
XrdCl::XRootDMsgHandler::pHasSessionId
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:557
XrdCl::XRootDMsgHandler::HandleLocalRedirect
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
XrdCl::XRootDMsgHandler::pReadVRawChunkHeaderStarted
bool pReadVRawChunkHeaderStarted
Definition: XrdClXRootDMsgHandler.hh:574
XrdCl::XRootDMsgHandler::ReadMessageBody
virtual Status ReadMessageBody(Message *msg, int socket, uint32_t &bytesRead)
XrdCl::XRootDMsgHandler::GetSid
virtual uint16_t GetSid() const
XrdCl::RedirectEntry::type
Type type
Definition: XrdClXRootDMsgHandler.hh:75
XrdCl::XRootDMsgHandler::pReadVRawMsgOffset
uint32_t pReadVRawMsgOffset
Definition: XrdClXRootDMsgHandler.hh:572
XrdCl::XRootDMsgHandler::SetRedirectAsAnswer
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:323
XrdCl::HostInfo::url
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:846
XrdCl::XRootDMsgHandler::pOksofarAsAnswer
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:553
XrdCl::XRootDMsgHandler::pHosts
HostList * pHosts
Definition: XrdClXRootDMsgHandler.hh:554
XrdCl
Definition: XrdClAnyObject.hh:25
XrdClDefaultEnv.hh
XrdCl::HostList
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:849
XrdCl::XRootDMsgHandler::ParseResponse
Status ParseResponse(AnyObject *&response)
XrdCl::XRootDMsgHandler::pEffectiveDataServerUrl
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:545
XrdCl::VectorReadInfo
Vector read info.
Definition: XrdClXRootDResponses.hh:789
XrdCl::DefaultEnv::GetPostMaster
static PostMaster * GetPostMaster()
Get default post master.
XrdCl::XRootDMsgHandler::pPartialResps
std::vector< Message * > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:542
XrdCl::XRootDMsgHandler::SetRedirectCounter
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:380
XrdCl::XRootDMsgHandler::RewriteRequestRedirect
Status RewriteRequestRedirect(const URL &newUrl)
XrdCl::RedirectEntry::Type
Type
Definition: XrdClXRootDMsgHandler.hh:59
XrdCl::XRootDMsgHandler::ProcessStatus
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
XrdCl::XRootDMsgHandler::SetLoadBalancer
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:348
XrdCl::XRootDMsgHandler::pUrl
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:544
XrdCl::XRootDMsgHandler::SwitchOnRefreshFlag
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
XrdCl::HostInfo
Definition: XrdClXRootDResponses.hh:837
XrdCl::XRootDMsgHandler::pReadVRawChunkIndex
int32_t pReadVRawChunkIndex
Definition: XrdClXRootDMsgHandler.hh:576
XrdCl::XRootDMsgHandler::pDirListWithStat
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:609
XrdCl::XRootDMsgHandler::OnStatusReady
virtual void OnStatusReady(const Message *message, Status status)
The requested action has been performed and the status is available.
XrdCl::Status
Procedure execution status.
Definition: XrdClStatus.hh:109
XrdCl::URL
URL representation.
Definition: XrdClURL.hh:30
XrdCl::XRootDMsgHandler::pRedirectUrl
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:558
XrdCl::XRootDMsgHandler::SetExpiration
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:314
XrdCl::URL::IsValid
bool IsValid() const
Is the url valid.
XrdCl::XRootDMsgHandler::ChunkStatus
Definition: XrdClXRootDMsgHandler.hh:531
XrdCl::XRootDMsgHandler::XRootDMsgHandler
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, SIDManager *sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:122
XrdCl::XRootDMsgHandler::pReadRawStarted
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:569
XrdCl::XRootDMsgHandler::pLoadBalancer
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:556
XrdCl::XRootDMsgHandler::IsRaw
virtual bool IsRaw() const
Are we a raw writer or not?
XrdCl::ExDbgMsg
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:41
XrdCl::AnyObject
Definition: XrdClAnyObject.hh:32
XrdCl::XRootDMsgHandler::OnStreamEvent
virtual uint8_t OnStreamEvent(StreamEvent event, uint16_t streamNum, Status status)
XrdCl::XRootDMsgHandler::ReadRawOther
Status ReadRawOther(Message *msg, int socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
XrdCl::XRootDMsgHandler::RetryAtServer
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
XrdCl::XRootDMsgHandler::TakeDownTimeoutFence
void TakeDownTimeoutFence()
Take down the timeout fence after oksofar response has been handled.
XrdCl::XRootDMsgHandler::SetFollowMetalink
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:385
XrdCl::XRootDMsgHandler::ReadRawReadV
Status ReadRawReadV(Message *msg, int socket, uint32_t &bytesRead)
Handle a kXR_readv in raw mode.
XrdCl::XRootDMsgHandler::pOtherRawStarted
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:580
XrdCl::XRootDMsgHandler::WaitDone
void WaitDone(time_t now)
XrdCl::PostMaster
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:44
XrdCl::XRootDMsgHandler::pLastError
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:550
XrdCl::XRootDMsgHandler::HandleRspJob
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:109