xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
41 
42 #include "XrdSys/XrdSysPthread.hh"
43 #include "XrdSys/XrdSysPageSize.hh"
45 #include "XrdSys/XrdSysPlatform.hh"
46 
48 
49 #include <sys/uio.h>
50 #include <arpa/inet.h> // for network unmarshaling stuff
51 
52 #include <array>
53 #include <list>
54 #include <memory>
55 #include <atomic>
56 #include <memory>
57 
58 namespace XrdCl
59 {
60  class PostMaster;
61  class SIDManager;
62  class URL;
63  class LocalFileHandler;
64  class Socket;
65 
66  //----------------------------------------------------------------------------
67  // Single entry in the redirect-trace-back
68  //----------------------------------------------------------------------------
70  {
71  enum Type
72  {
77  };
78 
79  RedirectEntry( const URL &from, const URL &to, Type type ) :
80  from( from ), to( to ), type( type )
81  {
82 
83  }
84 
89 
90  std::string ToString( bool prevok = true )
91  {
92  const std::string tostr = to.GetLocation();
93  const std::string fromstr = from.GetLocation();
94 
95  if( prevok )
96  {
97  switch( type )
98  {
99  case EntryRedirect: return "Redirected from: " + fromstr + " to: "
100  + tostr;
101 
102  case EntryRedirectOnWait: return "Server responded with wait. "
103  "Falling back to virtual redirector: " + tostr;
104 
105  case EntryRetry: return "Retrying: " + tostr;
106 
107  case EntryWait: return "Waited at server request. Resending: "
108  + tostr;
109  }
110  }
111  return "Failed at: " + fromstr + ", retrying at: " + tostr;
112  }
113  };
114 
115  //----------------------------------------------------------------------------
117  //----------------------------------------------------------------------------
119  {
120  friend class HandleRspJob;
121 
122  public:
123  //------------------------------------------------------------------------
132  //------------------------------------------------------------------------
134  ResponseHandler *respHandler,
135  const URL *url,
136  std::shared_ptr<SIDManager> sidMgr,
137  LocalFileHandler *lFileHandler):
138  pRequest( msg ),
139  pResponseHandler( respHandler ),
140  pUrl( *url ),
142  pSidMgr( sidMgr ),
143  pLFileHandler( lFileHandler ),
144  pExpiration( 0 ),
145  pRedirectAsAnswer( false ),
146  pOksofarAsAnswer( false ),
147  pHasLoadBalancer( false ),
148  pHasSessionId( false ),
149  pChunkList( 0 ),
150  pKBuff( 0 ),
151  pRedirectCounter( 0 ),
153 
154  pAsyncOffset( 0 ),
155  pAsyncChunkIndex( 0 ),
156 
157  pPgWrtCksumBuff( 4 ),
159  pPgWrtCurrentPageNb( 0 ),
160 
161  pOtherRawStarted( false ),
162 
163  pFollowMetalink( false ),
164 
165  pStateful( false ),
166 
167  pAggregatedWaitTime( 0 ),
168 
169  pMsgInFly( false ),
170 
171  pTimeoutFence( false ),
172 
173  pDirListStarted( false ),
174  pDirListWithStat( false ),
175 
176  pCV( 0 ),
177 
178  pSslErrCnt( 0 ),
179 
180  pRspStatusBodyUnMarshaled( false ),
182  {
184  if( msg->GetSessionId() )
185  pHasSessionId = true;
186 
187  Log *log = DefaultEnv::GetLog();
188  log->Debug( ExDbgMsg, "[%s] MsgHandler created: 0x%x (message: %s ).",
189  pUrl.GetHostId().c_str(), this,
190  pRequest->GetDescription().c_str() );
191 
193  if( ntohs( hdr->requestid ) == kXR_pgread )
194  {
196  pCrc32cDigests.reserve( XrdOucPgrwUtils::csNum( ntohll( pgrdreq->offset ),
197  ntohl( pgrdreq->rlen ) ) );
198  }
199 
200  if( ntohs( hdr->requestid ) == kXR_readv )
201  pBodyReader.reset( new AsyncVectorReader( *url, *pRequest ) );
202  else if( ntohs( hdr->requestid ) == kXR_read )
203  pBodyReader.reset( new AsyncRawReader( *url, *pRequest ) );
204  else
205  pBodyReader.reset( new AsyncDiscardReader( *url, *pRequest ) );
206  }
207 
208  //------------------------------------------------------------------------
210  //------------------------------------------------------------------------
212  {
214 
215  if( !pHasSessionId )
216  delete pRequest;
218 
219  pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
220  pResponseHandler = reinterpret_cast<ResponseHandler*>( 0xDEADBEEF );
221  pPostMaster = reinterpret_cast<PostMaster*>( 0xDEADBEEF );
222  pLFileHandler = reinterpret_cast<LocalFileHandler*>( 0xDEADBEEF );
223  pChunkList = reinterpret_cast<ChunkList*>( 0xDEADBEEF );
224  pEffectiveDataServerUrl = reinterpret_cast<URL*>( 0xDEADBEEF );
225 
226  Log *log = DefaultEnv::GetLog();
227  log->Debug( ExDbgMsg, "[%s] Destroying MsgHandler: 0x%x.",
228  pUrl.GetHostId().c_str(), this );
229  }
230 
231  //------------------------------------------------------------------------
237  //------------------------------------------------------------------------
238  virtual uint16_t Examine( std::shared_ptr<Message> &msg );
239 
240  //------------------------------------------------------------------------
249  //------------------------------------------------------------------------
250  virtual uint16_t InspectStatusRsp();
251 
252  //------------------------------------------------------------------------
256  //------------------------------------------------------------------------
257  virtual uint16_t GetSid() const;
258 
259  //------------------------------------------------------------------------
263  //------------------------------------------------------------------------
264  virtual void Process();
265 
266  //------------------------------------------------------------------------
276  //------------------------------------------------------------------------
277  virtual XRootDStatus ReadMessageBody( Message *msg,
278  Socket *socket,
279  uint32_t &bytesRead );
280 
281  //------------------------------------------------------------------------
287  //------------------------------------------------------------------------
288  virtual uint8_t OnStreamEvent( StreamEvent event,
289  XRootDStatus status );
290 
291  //------------------------------------------------------------------------
293  //------------------------------------------------------------------------
294  virtual void OnStatusReady( const Message *message,
295  XRootDStatus status );
296 
297  //------------------------------------------------------------------------
299  //------------------------------------------------------------------------
300  virtual bool IsRaw() const;
301 
302  //------------------------------------------------------------------------
311  //------------------------------------------------------------------------
313  uint32_t &bytesWritten );
314 
315  //------------------------------------------------------------------------
319  //------------------------------------------------------------------------
320  void WaitDone( time_t now );
321 
322  //------------------------------------------------------------------------
324  //------------------------------------------------------------------------
325  void SetExpiration( time_t expiration )
326  {
327  pExpiration = expiration;
328  }
329 
330  //------------------------------------------------------------------------
332  //------------------------------------------------------------------------
333  time_t GetExpiration()
334  {
335  return pExpiration;
336  }
337 
338  //------------------------------------------------------------------------
341  //------------------------------------------------------------------------
342  void SetRedirectAsAnswer( bool redirectAsAnswer )
343  {
344  pRedirectAsAnswer = redirectAsAnswer;
345  }
346 
347  //------------------------------------------------------------------------
350  //------------------------------------------------------------------------
351  void SetOksofarAsAnswer( bool oksofarAsAnswer )
352  {
353  pOksofarAsAnswer = oksofarAsAnswer;
354  }
355 
356  //------------------------------------------------------------------------
358  //------------------------------------------------------------------------
359  const Message *GetRequest() const
360  {
361  return pRequest;
362  }
363 
364  //------------------------------------------------------------------------
366  //------------------------------------------------------------------------
367  void SetLoadBalancer( const HostInfo &loadBalancer )
368  {
369  if( !loadBalancer.url.IsValid() )
370  return;
371  pLoadBalancer = loadBalancer;
372  pHasLoadBalancer = true;
373  }
374 
375  //------------------------------------------------------------------------
377  //------------------------------------------------------------------------
378  void SetHostList( HostList *hostList )
379  {
380  pHosts.reset( hostList );
381  }
382 
383  //------------------------------------------------------------------------
385  //------------------------------------------------------------------------
386  void SetChunkList( ChunkList *chunkList )
387  {
388  pChunkList = chunkList;
389  if( pBodyReader )
390  pBodyReader->SetChunkList( chunkList );
391  if( chunkList )
392  pChunkStatus.resize( chunkList->size() );
393  else
394  pChunkStatus.clear();
395  }
396 
397  void SetCrc32cDigests( std::vector<uint32_t> && crc32cDigests )
398  {
399  pCrc32cDigests = std::move( crc32cDigests );
400  }
401 
402  //------------------------------------------------------------------------
404  //------------------------------------------------------------------------
406  {
407  pKBuff = kbuff;
408  }
409 
410  //------------------------------------------------------------------------
412  //------------------------------------------------------------------------
413  void SetRedirectCounter( uint16_t redirectCounter )
414  {
415  pRedirectCounter = redirectCounter;
416  }
417 
418  void SetFollowMetalink( bool followMetalink )
419  {
420  pFollowMetalink = followMetalink;
421  }
422 
423  void SetStateful( bool stateful )
424  {
425  pStateful = stateful;
426  }
427 
428  //------------------------------------------------------------------------
432  //------------------------------------------------------------------------
433  void PartialReceived();
434 
435  private:
436 
437  //------------------------------------------------------------------------
439  //------------------------------------------------------------------------
440  void HandleError( XRootDStatus status );
441 
442  //------------------------------------------------------------------------
444  //------------------------------------------------------------------------
445  Status RetryAtServer( const URL &url, RedirectEntry::Type entryType );
446 
447  //------------------------------------------------------------------------
449  //------------------------------------------------------------------------
450  void HandleResponse();
451 
452  //------------------------------------------------------------------------
454  //------------------------------------------------------------------------
456 
457  //------------------------------------------------------------------------
460  //------------------------------------------------------------------------
461  Status ParseResponse( AnyObject *&response );
462 
463  //------------------------------------------------------------------------
466  //------------------------------------------------------------------------
467  Status ParseXAttrResponse( char *data, size_t len, AnyObject *&response );
468 
469  //------------------------------------------------------------------------
472  //------------------------------------------------------------------------
473  Status RewriteRequestRedirect( const URL &newUrl );
474 
475  //------------------------------------------------------------------------
477  //------------------------------------------------------------------------
479 
480  //------------------------------------------------------------------------
482  //------------------------------------------------------------------------
483  void UpdateTriedCGI(uint32_t errNo=0);
484 
485  //------------------------------------------------------------------------
487  //------------------------------------------------------------------------
488  void SwitchOnRefreshFlag();
489 
490  //------------------------------------------------------------------------
493  //------------------------------------------------------------------------
494  void HandleRspOrQueue();
495 
496  //------------------------------------------------------------------------
498  //------------------------------------------------------------------------
499  void HandleLocalRedirect( URL *url );
500 
501  //------------------------------------------------------------------------
506  //------------------------------------------------------------------------
507  bool IsRetriable();
508 
509  //------------------------------------------------------------------------
516  //------------------------------------------------------------------------
517  bool OmitWait( Message &request, const URL &url );
518 
519  //------------------------------------------------------------------------
525  //------------------------------------------------------------------------
526  bool RetriableErrorResponse( const Status &status );
527 
528  //------------------------------------------------------------------------
530  //------------------------------------------------------------------------
531  void DumpRedirectTraceBack();
532 
539  //------------------------------------------------------------------------
540  template<typename T>
541  Status ReadFromBuffer( char *&buffer, size_t &buflen, T& result );
542 
543  //------------------------------------------------------------------------
550  //------------------------------------------------------------------------
551  Status ReadFromBuffer( char *&buffer, size_t &buflen, std::string &result );
552 
553  //------------------------------------------------------------------------
561  //------------------------------------------------------------------------
562  Status ReadFromBuffer( char *&buffer, size_t &buflen, size_t size,
563  std::string &result );
564 
565  //------------------------------------------------------------------------
566  // Helper struct for async reading of chunks
567  //------------------------------------------------------------------------
568  struct ChunkStatus
569  {
570  ChunkStatus(): sizeError( false ), done( false ) {}
571  bool sizeError;
572  bool done;
573  };
574 
575  typedef std::list<std::unique_ptr<RedirectEntry>> RedirectTraceBack;
576 
577  static const size_t CksumSize = sizeof( uint32_t );
578  static const size_t PageWithCksum = XrdSys::PageSize + CksumSize;
579  static const size_t MaxSslErrRetry = 3;
580 
581  inline static size_t NbPgPerRsp( uint64_t offset, uint32_t dlen )
582  {
583  uint32_t pgcnt = 0;
584  uint32_t remainder = offset % XrdSys::PageSize;
585  if( remainder > 0 )
586  {
587  // account for the first unaligned page
588  ++pgcnt;
589  // the size of the 1st unaligned page
590  uint32_t _1stpg = XrdSys::PageSize - remainder;
591  if( _1stpg + CksumSize > dlen )
592  _1stpg = dlen - CksumSize;
593  dlen -= _1stpg + CksumSize;
594  }
595  pgcnt += dlen / PageWithCksum;
596  if( dlen % PageWithCksum )
597  ++ pgcnt;
598  return pgcnt;
599  }
600 
602  std::shared_ptr<Message> pResponse; //< the ownership is shared with MsgReader
603  std::vector<std::shared_ptr<Message>> pPartialResps; //< the ownership is shared with MsgReader
608  std::shared_ptr<SIDManager> pSidMgr;
612  time_t pExpiration;
615  std::unique_ptr<HostList> pHosts;
619  std::string pRedirectUrl;
621  std::vector<uint32_t> pCrc32cDigests;
623  std::vector<ChunkStatus> pChunkStatus;
626 
627  uint32_t pAsyncOffset;
629 
630  std::unique_ptr<AsyncPageReader> pPageReader;
631  std::unique_ptr<AsyncRawReaderIntfc> pBodyReader;
632 
636 
638 
640 
641  bool pStateful;
643 
644  std::unique_ptr<RedirectEntry> pRdirEntry;
646 
647  bool pMsgInFly;
648 
649  //------------------------------------------------------------------------
650  // true if MsgHandler is both in inQueue and installed in respective
651  // Stream (this could happen if server gave oksofar response), otherwise
652  // false
653  //------------------------------------------------------------------------
654  std::atomic<bool> pTimeoutFence;
655 
656  //------------------------------------------------------------------------
657  // if we are serving chunked data to the user's handler in case of
658  // kXR_dirlist we need to memorize if the response contains stat info or
659  // not (the information is only encoded in the first chunk)
660  //------------------------------------------------------------------------
663 
664  //------------------------------------------------------------------------
665  // synchronization is needed in case the MsgHandler has been configured
666  // to serve kXR_oksofar as a response to the user's handler
667  //------------------------------------------------------------------------
669 
670  //------------------------------------------------------------------------
671  // Count of consecutive `errTlsSslError` errors
672  //------------------------------------------------------------------------
673  size_t pSslErrCnt;
674 
675  //------------------------------------------------------------------------
676  // Keep track if respective parts of kXR_status response have been
677  // unmarshaled.
678  //------------------------------------------------------------------------
681  };
682 }
683 
684 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
Status ParseXAttrResponse(char *data, size_t len, AnyObject *&response)
uint32_t pAsyncChunkIndex
Definition: XrdClXRootDMsgHandler.hh:628
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:637
Definition: XrdClAnyObject.hh:32
URL to
Definition: XrdClXRootDMsgHandler.hh:86
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:95
void UpdateTriedCGI(uint32_t errNo=0)
Update the &quot;tried=&quot; part of the CGI of the current message.
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:44
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:1046
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:607
Object for discarding data.
Definition: XrdClAsyncDiscardReader.hh:35
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.
The message representation used throughout the system.
Definition: XrdClMessage.hh:29
bool pRspStatusBodyUnMarshaled
Definition: XrdClXRootDMsgHandler.hh:679
std::string GetLocation() const
Get location (protocol://host:port/path)
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:570
bool RetriableErrorResponse(const Status &status)
bool IsValid() const
Is the url valid.
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:413
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:211
std::atomic< bool > pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:654
std::unique_ptr< AsyncPageReader > pPageReader
Definition: XrdClXRootDMsgHandler.hh:630
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:418
Buffer pPgWrtCksumBuff
Definition: XrdClXRootDMsgHandler.hh:633
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:645
static const size_t PageWithCksum
Definition: XrdClXRootDMsgHandler.hh:578
URL from
Definition: XrdClXRootDMsgHandler.hh:85
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:609
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:625
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:90
virtual uint16_t Examine(std::shared_ptr< Message > &msg)
Object for reading out data from the kXR_read response.
Definition: XrdClAsyncRawReader.hh:34
std::shared_ptr< Message > pResponse
Definition: XrdClXRootDMsgHandler.hh:602
Message handler.
Definition: XrdClPostMasterInterfaces.hh:50
std::unique_ptr< AsyncRawReaderIntfc > pBodyReader
Definition: XrdClXRootDMsgHandler.hh:631
virtual XRootDStatus ReadMessageBody(Message *msg, Socket *socket, uint32_t &bytesRead)
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:623
kXR_unt16 requestid
Definition: XProtocol.hh:157
Definition: XrdClXRootDMsgHandler.hh:568
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, std::shared_ptr< SIDManager > sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:133
kXR_int32 rlen
Definition: XProtocol.hh:511
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:120
void SetKernelBuffer(XrdSys::KernelBuffer *kbuff)
Set the kernel buffer.
Definition: XrdClXRootDMsgHandler.hh:405
Status ParseResponse(AnyObject *&response)
virtual uint16_t GetSid() const
static size_t NbPgPerRsp(uint64_t offset, uint32_t dlen)
Definition: XrdClXRootDMsgHandler.hh:581
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:639
Status ReadFromBuffer(char *&buffer, size_t &buflen, T &result)
bool done
Definition: XrdClXRootDMsgHandler.hh:572
const char * GetBuffer(uint32_t offset=0) const
Get the message buffer.
Definition: XrdClBuffer.hh:72
Procedure execution status.
Definition: XrdClStatus.hh:113
static const size_t CksumSize
Definition: XrdClXRootDMsgHandler.hh:577
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:605
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:78
virtual void OnStatusReady(const Message *message, XRootDStatus status)
The requested action has been performed and the status is available.
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:601
Definition: XrdClXRootDMsgHandler.hh:74
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:612
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:325
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:624
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:608
static Log * GetLog()
Get default log.
XRootDStatus WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:618
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:620
Definition: XrdClXRootDResponses.hh:1099
bool pRspPgWrtRetrnsmReqUnMarshalled
Definition: XrdClXRootDMsgHandler.hh:680
Definition: XProtocol.hh:506
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:1111
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:614
static const size_t MaxSslErrRetry
Definition: XrdClXRootDMsgHandler.hh:579
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:662
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:575
Definition: XrdSysPthread.hh:78
XrdSys::KernelBuffer * pKBuff
Definition: XrdClXRootDMsgHandler.hh:622
Object for reading out data from the VectorRead response.
Definition: XrdClAsyncVectorReader.hh:32
static const int PageSize
Definition: XrdSysPageSize.hh:36
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:79
XRootDStatus pStatus
Definition: XrdClXRootDMsgHandler.hh:610
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:88
Request status.
Definition: XrdClXRootDResponses.hh:218
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:606
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:94
Type type
Definition: XrdClXRootDMsgHandler.hh:87
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:642
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:386
virtual void Process()
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:661
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:111
virtual uint16_t InspectStatusRsp()
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:342
Definition: XProtocol.hh:142
std::unique_ptr< HostList > pHosts
Definition: XrdClXRootDMsgHandler.hh:615
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:619
Definition: XrdSysKernelBuffer.hh:45
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:1108
uint32_t pPgWrtCurrentPageNb
Definition: XrdClXRootDMsgHandler.hh:635
Definition: XProtocol.hh:155
bool OmitWait(Message &request, const URL &url)
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:571
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:613
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:641
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:359
Handle an async response.
Definition: XrdClXRootDResponses.hh:1116
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:423
uint32_t pPgWrtCurrentPageOffset
Definition: XrdClXRootDMsgHandler.hh:634
Definition: XrdClLocalFileHandler.hh:32
URL representation.
Definition: XrdClURL.hh:30
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:627
std::vector< std::shared_ptr< Message > > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:603
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:644
Definition: XrdClXRootDMsgHandler.hh:73
kXR_int64 offset
Definition: XProtocol.hh:510
void WaitDone(time_t now)
size_t pSslErrCnt
Definition: XrdClXRootDMsgHandler.hh:673
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:611
time_t GetExpiration()
Get a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:333
Definition: XrdClXRootDMsgHandler.hh:76
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:47
Type
Definition: XrdClXRootDMsgHandler.hh:71
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:617
static PostMaster * GetPostMaster()
Get default post master.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:118
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:668
void HandleError(XRootDStatus status)
Recover error.
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
void SetCrc32cDigests(std::vector< uint32_t > &&crc32cDigests)
Definition: XrdClXRootDMsgHandler.hh:397
void HandleResponse()
Unpack the message and call the response handler.
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:616
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:604
Definition: XrdClXRootDMsgHandler.hh:69
static int csNum(off_t offs, int count)
Compute the required size of a checksum vector based on offset &amp; length.
Definition: XProtocol.hh:125
std::vector< uint32_t > pCrc32cDigests
Definition: XrdClXRootDMsgHandler.hh:621
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:647
A network socket.
Definition: XrdClSocket.hh:42
Definition: XProtocol.hh:137
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:351
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
Handle diagnostics.
Definition: XrdClLog.hh:100
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:367
Binary blob representation.
Definition: XrdClBuffer.hh:33
Definition: XrdClXRootDMsgHandler.hh:75
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:378