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 
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  {
76  EntryWait
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  //------------------------------------------------------------------------
278  Socket *socket,
279  uint32_t &bytesRead );
280 
281  //------------------------------------------------------------------------
286  //------------------------------------------------------------------------
287  virtual uint8_t OnStreamEvent( StreamEvent event,
288  XRootDStatus status );
289 
290  //------------------------------------------------------------------------
292  //------------------------------------------------------------------------
293  virtual void OnStatusReady( const Message *message,
294  XRootDStatus status );
295 
296  //------------------------------------------------------------------------
298  //------------------------------------------------------------------------
299  virtual bool IsRaw() const;
300 
301  //------------------------------------------------------------------------
310  //------------------------------------------------------------------------
312  uint32_t &bytesWritten );
313 
314  //------------------------------------------------------------------------
318  //------------------------------------------------------------------------
319  void WaitDone( time_t now );
320 
321  //------------------------------------------------------------------------
323  //------------------------------------------------------------------------
324  void SetExpiration( time_t expiration )
325  {
326  pExpiration = expiration;
327  }
328 
329  //------------------------------------------------------------------------
331  //------------------------------------------------------------------------
332  time_t GetExpiration()
333  {
334  return pExpiration;
335  }
336 
337  //------------------------------------------------------------------------
340  //------------------------------------------------------------------------
341  void SetRedirectAsAnswer( bool redirectAsAnswer )
342  {
343  pRedirectAsAnswer = redirectAsAnswer;
344  }
345 
346  //------------------------------------------------------------------------
349  //------------------------------------------------------------------------
350  void SetOksofarAsAnswer( bool oksofarAsAnswer )
351  {
352  pOksofarAsAnswer = oksofarAsAnswer;
353  }
354 
355  //------------------------------------------------------------------------
357  //------------------------------------------------------------------------
358  const Message *GetRequest() const
359  {
360  return pRequest;
361  }
362 
363  //------------------------------------------------------------------------
365  //------------------------------------------------------------------------
366  void SetLoadBalancer( const HostInfo &loadBalancer )
367  {
368  if( !loadBalancer.url.IsValid() )
369  return;
370  pLoadBalancer = loadBalancer;
371  pHasLoadBalancer = true;
372  }
373 
374  //------------------------------------------------------------------------
376  //------------------------------------------------------------------------
377  void SetHostList( HostList *hostList )
378  {
379  pHosts.reset( hostList );
380  }
381 
382  //------------------------------------------------------------------------
384  //------------------------------------------------------------------------
385  void SetChunkList( ChunkList *chunkList )
386  {
387  pChunkList = chunkList;
388  if( pBodyReader )
389  pBodyReader->SetChunkList( chunkList );
390  if( chunkList )
391  pChunkStatus.resize( chunkList->size() );
392  else
393  pChunkStatus.clear();
394  }
395 
396  void SetCrc32cDigests( std::vector<uint32_t> && crc32cDigests )
397  {
398  pCrc32cDigests = std::move( crc32cDigests );
399  }
400 
401  //------------------------------------------------------------------------
403  //------------------------------------------------------------------------
405  {
406  pKBuff = kbuff;
407  }
408 
409  //------------------------------------------------------------------------
411  //------------------------------------------------------------------------
412  void SetRedirectCounter( uint16_t redirectCounter )
413  {
414  pRedirectCounter = redirectCounter;
415  }
416 
417  void SetFollowMetalink( bool followMetalink )
418  {
419  pFollowMetalink = followMetalink;
420  }
421 
422  void SetStateful( bool stateful )
423  {
424  pStateful = stateful;
425  }
426 
427  //------------------------------------------------------------------------
431  //------------------------------------------------------------------------
433 
434  private:
435 
436  //------------------------------------------------------------------------
438  //------------------------------------------------------------------------
439  void HandleError( XRootDStatus status );
440 
441  //------------------------------------------------------------------------
443  //------------------------------------------------------------------------
444  Status RetryAtServer( const URL &url, RedirectEntry::Type entryType );
445 
446  //------------------------------------------------------------------------
448  //------------------------------------------------------------------------
450 
451  //------------------------------------------------------------------------
453  //------------------------------------------------------------------------
455 
456  //------------------------------------------------------------------------
459  //------------------------------------------------------------------------
461 
462  //------------------------------------------------------------------------
465  //------------------------------------------------------------------------
466  Status ParseXAttrResponse( char *data, size_t len, AnyObject *&response );
467 
468  //------------------------------------------------------------------------
471  //------------------------------------------------------------------------
473 
474  //------------------------------------------------------------------------
476  //------------------------------------------------------------------------
478 
479  //------------------------------------------------------------------------
481  //------------------------------------------------------------------------
482  void UpdateTriedCGI(uint32_t errNo=0);
483 
484  //------------------------------------------------------------------------
486  //------------------------------------------------------------------------
488 
489  //------------------------------------------------------------------------
492  //------------------------------------------------------------------------
494 
495  //------------------------------------------------------------------------
497  //------------------------------------------------------------------------
498  void HandleLocalRedirect( URL *url );
499 
500  //------------------------------------------------------------------------
505  //------------------------------------------------------------------------
506  bool IsRetriable();
507 
508  //------------------------------------------------------------------------
515  //------------------------------------------------------------------------
516  bool OmitWait( Message &request, const URL &url );
517 
518  //------------------------------------------------------------------------
524  //------------------------------------------------------------------------
525  bool RetriableErrorResponse( const Status &status );
526 
527  //------------------------------------------------------------------------
529  //------------------------------------------------------------------------
531 
538  //------------------------------------------------------------------------
539  template<typename T>
540  Status ReadFromBuffer( char *&buffer, size_t &buflen, T& result );
541 
542  //------------------------------------------------------------------------
549  //------------------------------------------------------------------------
550  Status ReadFromBuffer( char *&buffer, size_t &buflen, std::string &result );
551 
552  //------------------------------------------------------------------------
560  //------------------------------------------------------------------------
561  Status ReadFromBuffer( char *&buffer, size_t &buflen, size_t size,
562  std::string &result );
563 
564  //------------------------------------------------------------------------
565  // Helper struct for async reading of chunks
566  //------------------------------------------------------------------------
567  struct ChunkStatus
568  {
569  ChunkStatus(): sizeError( false ), done( false ) {}
570  bool sizeError;
571  bool done;
572  };
573 
574  typedef std::list<std::unique_ptr<RedirectEntry>> RedirectTraceBack;
575 
576  static const size_t CksumSize = sizeof( uint32_t );
577  static const size_t PageWithCksum = XrdSys::PageSize + CksumSize;
578  static const size_t MaxSslErrRetry = 3;
579 
580  inline static size_t NbPgPerRsp( uint64_t offset, uint32_t dlen )
581  {
582  uint32_t pgcnt = 0;
583  uint32_t remainder = offset % XrdSys::PageSize;
584  if( remainder > 0 )
585  {
586  // account for the first unaligned page
587  ++pgcnt;
588  // the size of the 1st unaligned page
589  uint32_t _1stpg = XrdSys::PageSize - remainder;
590  if( _1stpg + CksumSize > dlen )
591  _1stpg = dlen - CksumSize;
592  dlen -= _1stpg + CksumSize;
593  }
594  pgcnt += dlen / PageWithCksum;
595  if( dlen % PageWithCksum )
596  ++ pgcnt;
597  return pgcnt;
598  }
599 
601  std::shared_ptr<Message> pResponse; //< the ownership is shared with MsgReader
602  std::vector<std::shared_ptr<Message>> pPartialResps; //< the ownership is shared with MsgReader
607  std::shared_ptr<SIDManager> pSidMgr;
611  time_t pExpiration;
614  std::unique_ptr<HostList> pHosts;
618  std::string pRedirectUrl;
620  std::vector<uint32_t> pCrc32cDigests;
622  std::vector<ChunkStatus> pChunkStatus;
625 
626  uint32_t pAsyncOffset;
628 
629  std::unique_ptr<AsyncPageReader> pPageReader;
630  std::unique_ptr<AsyncRawReaderIntfc> pBodyReader;
631 
635 
637 
639 
640  bool pStateful;
642 
643  std::unique_ptr<RedirectEntry> pRdirEntry;
645 
646  bool pMsgInFly;
647 
648  //------------------------------------------------------------------------
649  // true if MsgHandler is both in inQueue and installed in respective
650  // Stream (this could happen if server gave oksofar response), otherwise
651  // false
652  //------------------------------------------------------------------------
653  std::atomic<bool> pTimeoutFence;
654 
655  //------------------------------------------------------------------------
656  // if we are serving chunked data to the user's handler in case of
657  // kXR_dirlist we need to memorize if the response contains stat info or
658  // not (the information is only encoded in the first chunk)
659  //------------------------------------------------------------------------
662 
663  //------------------------------------------------------------------------
664  // synchronization is needed in case the MsgHandler has been configured
665  // to serve kXR_oksofar as a response to the user's handler
666  //------------------------------------------------------------------------
668 
669  //------------------------------------------------------------------------
670  // Count of consecutive `errTlsSslError` errors
671  //------------------------------------------------------------------------
672  size_t pSslErrCnt;
673 
674  //------------------------------------------------------------------------
675  // Keep track if respective parts of kXR_status response have been
676  // unmarshaled.
677  //------------------------------------------------------------------------
680  };
681 }
682 
683 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
@ kXR_read
Definition: XProtocol.hh:125
@ kXR_readv
Definition: XProtocol.hh:137
@ kXR_pgread
Definition: XProtocol.hh:142
Definition: XrdClAnyObject.hh:33
Object for discarding data.
Definition: XrdClAsyncDiscardReader.hh:36
Object for reading out data from the kXR_read response.
Definition: XrdClAsyncRawReader.hh:35
Object for reading out data from the VectorRead response.
Definition: XrdClAsyncVectorReader.hh:33
Binary blob representation.
Definition: XrdClBuffer.hh:34
const char * GetBuffer(uint32_t offset=0) const
Get the message buffer.
Definition: XrdClBuffer.hh:72
static PostMaster * GetPostMaster()
Get default post master.
static Log * GetLog()
Get default log.
Definition: XrdClLocalFileHandler.hh:33
Handle diagnostics.
Definition: XrdClLog.hh:101
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
The message representation used throughout the system.
Definition: XrdClMessage.hh:30
const std::string & GetDescription() const
Get the description of the message.
Definition: XrdClMessage.hh:95
uint64_t GetSessionId() const
Get the session ID the message is meant for.
Definition: XrdClMessage.hh:111
Message handler.
Definition: XrdClPostMasterInterfaces.hh:51
StreamEvent
Events that may have occurred to the stream.
Definition: XrdClPostMasterInterfaces.hh:79
A hub for dispatching and receiving messages.
Definition: XrdClPostMaster.hh:48
Handle an async response.
Definition: XrdClXRootDResponses.hh:1126
A network socket.
Definition: XrdClSocket.hh:43
URL representation.
Definition: XrdClURL.hh:31
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
Definition: XrdClURL.hh:94
std::string GetLocation() const
Get location (protocol://host:port/path)
bool IsValid() const
Is the url valid.
Handle/Process/Forward XRootD messages.
Definition: XrdClXRootDMsgHandler.hh:119
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:412
Status ReadFromBuffer(char *&buffer, size_t &buflen, std::string &result)
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:660
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:615
XRootDStatus WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:646
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:417
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:358
bool pRspStatusBodyUnMarshaled
Definition: XrdClXRootDMsgHandler.hh:678
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:385
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:377
std::unique_ptr< AsyncRawReaderIntfc > pBodyReader
Definition: XrdClXRootDMsgHandler.hh:630
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:120
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:624
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:619
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:643
uint32_t pPgWrtCurrentPageOffset
Definition: XrdClXRootDMsgHandler.hh:633
virtual uint16_t InspectStatusRsp()
void SetCrc32cDigests(std::vector< uint32_t > &&crc32cDigests)
Definition: XrdClXRootDMsgHandler.hh:396
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:626
std::atomic< bool > pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:653
void HandleResponse()
Unpack the message and call the response handler.
static const size_t MaxSslErrRetry
Definition: XrdClXRootDMsgHandler.hh:578
static const size_t CksumSize
Definition: XrdClXRootDMsgHandler.hh:576
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:616
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:636
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:608
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:366
void HandleLocalRedirect(URL *url)
Handle a redirect to a local file.
bool OmitWait(Message &request, const URL &url)
Status RewriteRequestWait()
Some requests need to be rewritten also after getting kXR_wait - sigh.
bool RetriableErrorResponse(const Status &status)
static size_t NbPgPerRsp(uint64_t offset, uint32_t dlen)
Definition: XrdClXRootDMsgHandler.hh:580
void DumpRedirectTraceBack()
Dump the redirect-trace-back into the log file.
virtual uint16_t GetSid() const
Status ParseResponse(AnyObject *&response)
virtual void Process()
virtual void OnStatusReady(const Message *message, XRootDStatus status)
The requested action has been performed and the status is available.
URL * pEffectiveDataServerUrl
Definition: XrdClXRootDMsgHandler.hh:605
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:622
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:618
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, std::shared_ptr< SIDManager > sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:133
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:613
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:644
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:661
void SwitchOnRefreshFlag()
Switch on the refresh flag for some requests.
Status ReadFromBuffer(char *&buffer, size_t &buflen, size_t size, std::string &result)
int pAggregatedWaitTime
Definition: XrdClXRootDMsgHandler.hh:641
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:607
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:211
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:606
std::unique_ptr< AsyncPageReader > pPageReader
Definition: XrdClXRootDMsgHandler.hh:629
void WaitDone(time_t now)
std::vector< uint32_t > pCrc32cDigests
Definition: XrdClXRootDMsgHandler.hh:620
size_t pSslErrCnt
Definition: XrdClXRootDMsgHandler.hh:672
Status RewriteRequestRedirect(const URL &newUrl)
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:422
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:640
time_t GetExpiration()
Get a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:332
std::shared_ptr< Message > pResponse
Definition: XrdClXRootDMsgHandler.hh:601
virtual uint8_t OnStreamEvent(StreamEvent event, XRootDStatus status)
XrdSys::KernelBuffer * pKBuff
Definition: XrdClXRootDMsgHandler.hh:621
bool pRspPgWrtRetrnsmReqUnMarshalled
Definition: XrdClXRootDMsgHandler.hh:679
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:638
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:611
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:623
std::vector< std::shared_ptr< Message > > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:602
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:600
static const size_t PageWithCksum
Definition: XrdClXRootDMsgHandler.hh:577
uint32_t pPgWrtCurrentPageNb
Definition: XrdClXRootDMsgHandler.hh:634
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:350
virtual XRootDStatus ReadMessageBody(Message *msg, Socket *socket, uint32_t &bytesRead)
void SetKernelBuffer(XrdSys::KernelBuffer *kbuff)
Set the kernel buffer.
Definition: XrdClXRootDMsgHandler.hh:404
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:617
virtual bool IsRaw() const
Are we a raw writer or not?
void HandleError(XRootDStatus status)
Recover error.
virtual uint16_t Examine(std::shared_ptr< Message > &msg)
URL pUrl
Definition: XrdClXRootDMsgHandler.hh:604
std::unique_ptr< HostList > pHosts
Definition: XrdClXRootDMsgHandler.hh:614
Status ParseXAttrResponse(char *data, size_t len, AnyObject *&response)
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:667
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:603
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:610
XRootDStatus pStatus
Definition: XrdClXRootDMsgHandler.hh:609
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:574
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:324
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:612
Buffer pPgWrtCksumBuff
Definition: XrdClXRootDMsgHandler.hh:632
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:341
uint32_t pAsyncChunkIndex
Definition: XrdClXRootDMsgHandler.hh:627
Status ReadFromBuffer(char *&buffer, size_t &buflen, T &result)
Request status.
Definition: XrdClXRootDResponses.hh:219
static int csNum(off_t offs, int count)
Compute the required size of a checksum vector based on offset & length.
Definition: XrdSysPthread.hh:79
Definition: XrdSysKernelBuffer.hh:46
Definition: XrdClAction.hh:34
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:1120
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:44
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:1055
static const int PageSize
Definition: XrdSysPageSize.hh:36
Definition: XProtocol.hh:506
kXR_int32 rlen
Definition: XProtocol.hh:511
kXR_int64 offset
Definition: XProtocol.hh:510
Definition: XProtocol.hh:155
kXR_unt16 requestid
Definition: XProtocol.hh:157
Definition: XrdClXRootDResponses.hh:1109
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:1117
Definition: XrdClXRootDMsgHandler.hh:70
Type type
Definition: XrdClXRootDMsgHandler.hh:87
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:79
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:88
URL from
Definition: XrdClXRootDMsgHandler.hh:85
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:90
URL to
Definition: XrdClXRootDMsgHandler.hh:86
Type
Definition: XrdClXRootDMsgHandler.hh:72
@ EntryRedirect
Definition: XrdClXRootDMsgHandler.hh:73
@ EntryRetry
Definition: XrdClXRootDMsgHandler.hh:75
@ EntryRedirectOnWait
Definition: XrdClXRootDMsgHandler.hh:74
@ EntryWait
Definition: XrdClXRootDMsgHandler.hh:76
Procedure execution status.
Definition: XrdClStatus.hh:115
Definition: XrdClXRootDMsgHandler.hh:568
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:569
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:570
bool done
Definition: XrdClXRootDMsgHandler.hh:571