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  {
181  if( msg->GetSessionId() )
182  pHasSessionId = true;
183 
184  Log *log = DefaultEnv::GetLog();
185  log->Debug( ExDbgMsg, "[%s] MsgHandler created: 0x%x (message: %s ).",
186  pUrl.GetHostId().c_str(), this,
187  pRequest->GetDescription().c_str() );
188 
190  if( ntohs( hdr->requestid ) == kXR_pgread )
191  {
193  pCrc32cDigests.reserve( XrdOucPgrwUtils::csNum( ntohll( pgrdreq->offset ),
194  ntohl( pgrdreq->rlen ) ) );
195  }
196 
197  if( ntohs( hdr->requestid ) == kXR_readv )
198  pBodyReader.reset( new AsyncVectorReader( *url, *pRequest ) );
199  else if( ntohs( hdr->requestid ) == kXR_read )
200  pBodyReader.reset( new AsyncRawReader( *url, *pRequest ) );
201  else
202  pBodyReader.reset( new AsyncDiscardReader( *url, *pRequest ) );
203  }
204 
205  //------------------------------------------------------------------------
207  //------------------------------------------------------------------------
209  {
211 
212  if( !pHasSessionId )
213  delete pRequest;
215 
216  pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
217  pResponseHandler = reinterpret_cast<ResponseHandler*>( 0xDEADBEEF );
218  pPostMaster = reinterpret_cast<PostMaster*>( 0xDEADBEEF );
219  pLFileHandler = reinterpret_cast<LocalFileHandler*>( 0xDEADBEEF );
220  pChunkList = reinterpret_cast<ChunkList*>( 0xDEADBEEF );
221  pEffectiveDataServerUrl = reinterpret_cast<URL*>( 0xDEADBEEF );
222 
223  Log *log = DefaultEnv::GetLog();
224  log->Debug( ExDbgMsg, "[%s] Destroying MsgHandler: 0x%x.",
225  pUrl.GetHostId().c_str(), this );
226  }
227 
228  //------------------------------------------------------------------------
234  //------------------------------------------------------------------------
235  virtual uint16_t Examine( std::shared_ptr<Message> &msg );
236 
237  //------------------------------------------------------------------------
246  //------------------------------------------------------------------------
247  virtual uint16_t InspectStatusRsp();
248 
249  //------------------------------------------------------------------------
253  //------------------------------------------------------------------------
254  virtual uint16_t GetSid() const;
255 
256  //------------------------------------------------------------------------
260  //------------------------------------------------------------------------
261  virtual void Process();
262 
263  //------------------------------------------------------------------------
273  //------------------------------------------------------------------------
274  virtual XRootDStatus ReadMessageBody( Message *msg,
275  Socket *socket,
276  uint32_t &bytesRead );
277 
278  //------------------------------------------------------------------------
283  //------------------------------------------------------------------------
284  virtual uint8_t OnStreamEvent( StreamEvent event,
285  XRootDStatus status );
286 
287  //------------------------------------------------------------------------
289  //------------------------------------------------------------------------
290  virtual void OnStatusReady( const Message *message,
291  XRootDStatus status );
292 
293  //------------------------------------------------------------------------
295  //------------------------------------------------------------------------
296  virtual bool IsRaw() const;
297 
298  //------------------------------------------------------------------------
307  //------------------------------------------------------------------------
309  uint32_t &bytesWritten );
310 
311  //------------------------------------------------------------------------
315  //------------------------------------------------------------------------
316  void WaitDone( time_t now );
317 
318  //------------------------------------------------------------------------
320  //------------------------------------------------------------------------
321  void SetExpiration( time_t expiration )
322  {
323  pExpiration = expiration;
324  }
325 
326  //------------------------------------------------------------------------
328  //------------------------------------------------------------------------
329  time_t GetExpiration()
330  {
331  return pExpiration;
332  }
333 
334  //------------------------------------------------------------------------
337  //------------------------------------------------------------------------
338  void SetRedirectAsAnswer( bool redirectAsAnswer )
339  {
340  pRedirectAsAnswer = redirectAsAnswer;
341  }
342 
343  //------------------------------------------------------------------------
346  //------------------------------------------------------------------------
347  void SetOksofarAsAnswer( bool oksofarAsAnswer )
348  {
349  pOksofarAsAnswer = oksofarAsAnswer;
350  }
351 
352  //------------------------------------------------------------------------
354  //------------------------------------------------------------------------
355  const Message *GetRequest() const
356  {
357  return pRequest;
358  }
359 
360  //------------------------------------------------------------------------
362  //------------------------------------------------------------------------
363  void SetLoadBalancer( const HostInfo &loadBalancer )
364  {
365  if( !loadBalancer.url.IsValid() )
366  return;
367  pLoadBalancer = loadBalancer;
368  pHasLoadBalancer = true;
369  }
370 
371  //------------------------------------------------------------------------
373  //------------------------------------------------------------------------
374  void SetHostList( HostList *hostList )
375  {
376  pHosts.reset( hostList );
377  }
378 
379  //------------------------------------------------------------------------
381  //------------------------------------------------------------------------
382  void SetChunkList( ChunkList *chunkList )
383  {
384  pChunkList = chunkList;
385  if( pBodyReader )
386  pBodyReader->SetChunkList( chunkList );
387  if( chunkList )
388  pChunkStatus.resize( chunkList->size() );
389  else
390  pChunkStatus.clear();
391  }
392 
393  void SetCrc32cDigests( std::vector<uint32_t> && crc32cDigests )
394  {
395  pCrc32cDigests = std::move( crc32cDigests );
396  }
397 
398  //------------------------------------------------------------------------
400  //------------------------------------------------------------------------
402  {
403  pKBuff = kbuff;
404  }
405 
406  //------------------------------------------------------------------------
408  //------------------------------------------------------------------------
409  void SetRedirectCounter( uint16_t redirectCounter )
410  {
411  pRedirectCounter = redirectCounter;
412  }
413 
414  void SetFollowMetalink( bool followMetalink )
415  {
416  pFollowMetalink = followMetalink;
417  }
418 
419  void SetStateful( bool stateful )
420  {
421  pStateful = stateful;
422  }
423 
424  //------------------------------------------------------------------------
428  //------------------------------------------------------------------------
429  void PartialReceived();
430 
431  private:
432 
433  //------------------------------------------------------------------------
435  //------------------------------------------------------------------------
436  void HandleError( XRootDStatus status );
437 
438  //------------------------------------------------------------------------
440  //------------------------------------------------------------------------
441  Status RetryAtServer( const URL &url, RedirectEntry::Type entryType );
442 
443  //------------------------------------------------------------------------
445  //------------------------------------------------------------------------
446  void HandleResponse();
447 
448  //------------------------------------------------------------------------
450  //------------------------------------------------------------------------
452 
453  //------------------------------------------------------------------------
456  //------------------------------------------------------------------------
457  Status ParseResponse( AnyObject *&response );
458 
459  //------------------------------------------------------------------------
462  //------------------------------------------------------------------------
463  Status ParseXAttrResponse( char *data, size_t len, AnyObject *&response );
464 
465  //------------------------------------------------------------------------
468  //------------------------------------------------------------------------
469  Status RewriteRequestRedirect( const URL &newUrl );
470 
471  //------------------------------------------------------------------------
473  //------------------------------------------------------------------------
475 
476  //------------------------------------------------------------------------
478  //------------------------------------------------------------------------
479  void UpdateTriedCGI(uint32_t errNo=0);
480 
481  //------------------------------------------------------------------------
483  //------------------------------------------------------------------------
484  void SwitchOnRefreshFlag();
485 
486  //------------------------------------------------------------------------
489  //------------------------------------------------------------------------
490  void HandleRspOrQueue();
491 
492  //------------------------------------------------------------------------
494  //------------------------------------------------------------------------
495  void HandleLocalRedirect( URL *url );
496 
497  //------------------------------------------------------------------------
502  //------------------------------------------------------------------------
503  bool IsRetriable();
504 
505  //------------------------------------------------------------------------
512  //------------------------------------------------------------------------
513  bool OmitWait( Message &request, const URL &url );
514 
515  //------------------------------------------------------------------------
521  //------------------------------------------------------------------------
522  bool RetriableErrorResponse( const Status &status );
523 
524  //------------------------------------------------------------------------
526  //------------------------------------------------------------------------
527  void DumpRedirectTraceBack();
528 
535  //------------------------------------------------------------------------
536  template<typename T>
537  Status ReadFromBuffer( char *&buffer, size_t &buflen, T& result );
538 
539  //------------------------------------------------------------------------
546  //------------------------------------------------------------------------
547  Status ReadFromBuffer( char *&buffer, size_t &buflen, std::string &result );
548 
549  //------------------------------------------------------------------------
557  //------------------------------------------------------------------------
558  Status ReadFromBuffer( char *&buffer, size_t &buflen, size_t size,
559  std::string &result );
560 
561  //------------------------------------------------------------------------
562  // Helper struct for async reading of chunks
563  //------------------------------------------------------------------------
564  struct ChunkStatus
565  {
566  ChunkStatus(): sizeError( false ), done( false ) {}
567  bool sizeError;
568  bool done;
569  };
570 
571  typedef std::list<std::unique_ptr<RedirectEntry>> RedirectTraceBack;
572 
573  static const size_t CksumSize = sizeof( uint32_t );
574  static const size_t PageWithCksum = XrdSys::PageSize + CksumSize;
575  static const size_t MaxSslErrRetry = 3;
576 
577  inline static size_t NbPgPerRsp( uint64_t offset, uint32_t dlen )
578  {
579  uint32_t pgcnt = 0;
580  uint32_t remainder = offset % XrdSys::PageSize;
581  if( remainder > 0 )
582  {
583  // account for the first unaligned page
584  ++pgcnt;
585  // the size of the 1st unaligned page
586  uint32_t _1stpg = XrdSys::PageSize - remainder;
587  if( _1stpg + CksumSize > dlen )
588  _1stpg = dlen - CksumSize;
589  dlen -= _1stpg + CksumSize;
590  }
591  pgcnt += dlen / PageWithCksum;
592  if( dlen % PageWithCksum )
593  ++ pgcnt;
594  return pgcnt;
595  }
596 
598  std::shared_ptr<Message> pResponse; //< the ownership is shared with MsgReader
599  std::vector<std::shared_ptr<Message>> pPartialResps; //< the ownership is shared with MsgReader
604  std::shared_ptr<SIDManager> pSidMgr;
608  time_t pExpiration;
611  std::unique_ptr<HostList> pHosts;
615  std::string pRedirectUrl;
617  std::vector<uint32_t> pCrc32cDigests;
619  std::vector<ChunkStatus> pChunkStatus;
622 
623  uint32_t pAsyncOffset;
625 
626  std::unique_ptr<AsyncPageReader> pPageReader;
627  std::unique_ptr<AsyncRawReaderIntfc> pBodyReader;
628 
632 
634 
636 
637  bool pStateful;
639 
640  std::unique_ptr<RedirectEntry> pRdirEntry;
642 
643  bool pMsgInFly;
644 
645  //------------------------------------------------------------------------
646  // true if MsgHandler is both in inQueue and installed in respective
647  // Stream (this could happen if server gave oksofar response), otherwise
648  // false
649  //------------------------------------------------------------------------
650  std::atomic<bool> pTimeoutFence;
651 
652  //------------------------------------------------------------------------
653  // if we are serving chunked data to the user's handler in case of
654  // kXR_dirlist we need to memorize if the response contains stat info or
655  // not (the information is only encoded in the first chunk)
656  //------------------------------------------------------------------------
659 
660  //------------------------------------------------------------------------
661  // synchronization is needed in case the MsgHandler has been configured
662  // to serve kXR_oksofar as a response to the user's handler
663  //------------------------------------------------------------------------
665 
666  //------------------------------------------------------------------------
667  // Count of consecutive `errTlsSslError` errors
668  //------------------------------------------------------------------------
669  size_t pSslErrCnt;
670  };
671 }
672 
673 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
Status ParseXAttrResponse(char *data, size_t len, AnyObject *&response)
uint32_t pAsyncChunkIndex
Definition: XrdClXRootDMsgHandler.hh:624
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:633
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:1055
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:603
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
std::string GetLocation() const
Get location (protocol://host:port/path)
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:566
bool RetriableErrorResponse(const Status &status)
bool IsValid() const
Is the url valid.
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:409
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:208
std::atomic< bool > pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:650
std::unique_ptr< AsyncPageReader > pPageReader
Definition: XrdClXRootDMsgHandler.hh:626
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:414
Buffer pPgWrtCksumBuff
Definition: XrdClXRootDMsgHandler.hh:629
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:641
static const size_t PageWithCksum
Definition: XrdClXRootDMsgHandler.hh:574
URL from
Definition: XrdClXRootDMsgHandler.hh:85
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:605
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:621
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:598
Message handler.
Definition: XrdClPostMasterInterfaces.hh:50
std::unique_ptr< AsyncRawReaderIntfc > pBodyReader
Definition: XrdClXRootDMsgHandler.hh:627
virtual XRootDStatus ReadMessageBody(Message *msg, Socket *socket, uint32_t &bytesRead)
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:619
kXR_unt16 requestid
Definition: XProtocol.hh:157
Definition: XrdClXRootDMsgHandler.hh:564
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:401
Status ParseResponse(AnyObject *&response)
virtual uint16_t GetSid() const
static size_t NbPgPerRsp(uint64_t offset, uint32_t dlen)
Definition: XrdClXRootDMsgHandler.hh:577
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:635
Status ReadFromBuffer(char *&buffer, size_t &buflen, T &result)
bool done
Definition: XrdClXRootDMsgHandler.hh:568
const char * GetBuffer(uint32_t offset=0) const
Get the message buffer.
Definition: XrdClBuffer.hh:72
Procedure execution status.
Definition: XrdClStatus.hh:114
static const size_t CksumSize
Definition: XrdClXRootDMsgHandler.hh:573
Status RewriteRequestRedirect(const URL &newUrl)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:601
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:597
Definition: XrdClXRootDMsgHandler.hh:74
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:608
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:321
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:620
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:604
static Log * GetLog()
Get default log.
XRootDStatus WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:614
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:616
Definition: XrdClXRootDResponses.hh:1108
Definition: XProtocol.hh:506
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:1120
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:610
static const size_t MaxSslErrRetry
Definition: XrdClXRootDMsgHandler.hh:575
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:658
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:571
Definition: XrdSysPthread.hh:78
XrdSys::KernelBuffer * pKBuff
Definition: XrdClXRootDMsgHandler.hh:618
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:606
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:88
Request status.
Definition: XrdClXRootDResponses.hh:218
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:602
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:638
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:382
virtual void Process()
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:657
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:338
Definition: XProtocol.hh:142
std::unique_ptr< HostList > pHosts
Definition: XrdClXRootDMsgHandler.hh:611
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:615
Definition: XrdSysKernelBuffer.hh:45
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:1117
uint32_t pPgWrtCurrentPageNb
Definition: XrdClXRootDMsgHandler.hh:631
Definition: XProtocol.hh:155
bool OmitWait(Message &request, const URL &url)
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:567
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:609
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:637
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:355
Handle an async response.
Definition: XrdClXRootDResponses.hh:1125
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:419
uint32_t pPgWrtCurrentPageOffset
Definition: XrdClXRootDMsgHandler.hh:630
Definition: XrdClLocalFileHandler.hh:32
URL representation.
Definition: XrdClURL.hh:30
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:623
std::vector< std::shared_ptr< Message > > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:599
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:640
Definition: XrdClXRootDMsgHandler.hh:73
kXR_int64 offset
Definition: XProtocol.hh:510
void WaitDone(time_t now)
size_t pSslErrCnt
Definition: XrdClXRootDMsgHandler.hh:669
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:607
time_t GetExpiration()
Get a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:329
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:613
static PostMaster * GetPostMaster()
Get default post master.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:118
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:664
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:393
void HandleResponse()
Unpack the message and call the response handler.
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:612
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:600
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:617
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:643
A network socket.
Definition: XrdClSocket.hh:42
Definition: XProtocol.hh:137
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:347
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:363
Binary blob representation.
Definition: XrdClBuffer.hh:33
Definition: XrdClXRootDMsgHandler.hh:75
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:374