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"
37 
38 #include "XrdSys/XrdSysPthread.hh"
39 #include "XrdSys/XrdSysPageSize.hh"
41 #include "XrdSys/XrdSysPlatform.hh"
42 
44 
45 #include <sys/uio.h>
46 #include <arpa/inet.h> // for network unmarshaling stuff
47 
48 #include <array>
49 #include <list>
50 #include <memory>
51 #include <atomic>
52 #include <memory>
53 
54 namespace XrdCl
55 {
56  class PostMaster;
57  class SIDManager;
58  class URL;
59  class LocalFileHandler;
60  class Socket;
61 
62  //----------------------------------------------------------------------------
63  // Single entry in the redirect-trace-back
64  //----------------------------------------------------------------------------
66  {
67  enum Type
68  {
72  EntryWait
73  };
74 
75  RedirectEntry( const URL &from, const URL &to, Type type ) :
76  from( from ), to( to ), type( type )
77  {
78 
79  }
80 
85 
86  std::string ToString( bool prevok = true )
87  {
88  const std::string tostr = to.GetLocation();
89  const std::string fromstr = from.GetLocation();
90 
91  if( prevok )
92  {
93  switch( type )
94  {
95  case EntryRedirect: return "Redirected from: " + fromstr + " to: "
96  + tostr;
97 
98  case EntryRedirectOnWait: return "Server responded with wait. "
99  "Falling back to virtual redirector: " + tostr;
100 
101  case EntryRetry: return "Retrying: " + tostr;
102 
103  case EntryWait: return "Waited at server request. Resending: "
104  + tostr;
105  }
106  }
107  return "Failed at: " + fromstr + ", retrying at: " + tostr;
108  }
109  };
110 
111  //----------------------------------------------------------------------------
113  //----------------------------------------------------------------------------
115  {
116  friend class HandleRspJob;
117 
118  public:
119  //------------------------------------------------------------------------
128  //------------------------------------------------------------------------
130  ResponseHandler *respHandler,
131  const URL *url,
132  std::shared_ptr<SIDManager> sidMgr,
133  LocalFileHandler *lFileHandler):
134  pRequest( msg ),
135  pResponseHandler( respHandler ),
136  pUrl( *url ),
138  pSidMgr( sidMgr ),
139  pLFileHandler( lFileHandler ),
140  pExpiration( 0 ),
141  pRedirectAsAnswer( false ),
142  pOksofarAsAnswer( false ),
143  pHasLoadBalancer( false ),
144  pHasSessionId( false ),
145  pChunkList( 0 ),
146  pKBuff( 0 ),
147  pRedirectCounter( 0 ),
149 
150  pAsyncOffset( 0 ),
151  pAsyncChunkOffset( 0 ),
152  pAsyncChunkIndex( 0 ),
153  pAsyncReadSize( 0 ),
154  pAsyncReadBuffer( 0 ),
155  pAsyncMsgSize( 0 ),
156 
157  pReadRawStarted( false ),
159 
160  pPgWrtCksumBuff( 4 ),
162  pPgWrtCurrentPageNb( 0 ),
163 
164  pOtherRawStarted( false ),
165 
166  pFollowMetalink( false ),
167 
168  pStateful( false ),
169 
170  pAggregatedWaitTime( 0 ),
171 
172  pMsgInFly( false ),
173 
174  pTimeoutFence( false ),
175 
176  pDirListStarted( false ),
177  pDirListWithStat( false ),
178 
179  pCV( 0 ),
180 
181  pSslErrCnt( 0 ),
182 
183  pRspStatusBodyUnMarshaled( false ),
185  {
187  if( msg->GetSessionId() )
188  pHasSessionId = true;
189 
190  Log *log = DefaultEnv::GetLog();
191  log->Debug( ExDbgMsg, "[%s] MsgHandler created: 0x%x (message: %s ).",
192  pUrl.GetHostId().c_str(), this,
193  pRequest->GetDescription().c_str() );
194 
196  if( ntohs( hdr->requestid ) == kXR_pgread )
197  {
199  pCrc32cDigests.reserve( XrdOucPgrwUtils::csNum( ntohll( pgrdreq->offset ),
200  ntohl( pgrdreq->rlen ) ) );
201  }
202 
203  if( ntohs( hdr->requestid ) == kXR_readv )
204  {
205  pVectorReader.reset( new AsyncVectorReader( *url ) );
206  }
207  }
208 
209  //------------------------------------------------------------------------
211  //------------------------------------------------------------------------
213  {
215 
216  if( !pHasSessionId )
217  delete pRequest;
219 
220  pRequest = reinterpret_cast<Message*>( 0xDEADBEEF );
221  pResponseHandler = reinterpret_cast<ResponseHandler*>( 0xDEADBEEF );
222  pPostMaster = reinterpret_cast<PostMaster*>( 0xDEADBEEF );
223  pLFileHandler = reinterpret_cast<LocalFileHandler*>( 0xDEADBEEF );
224  pChunkList = reinterpret_cast<ChunkList*>( 0xDEADBEEF );
225  pEffectiveDataServerUrl = reinterpret_cast<URL*>( 0xDEADBEEF );
226 
227  Log *log = DefaultEnv::GetLog();
228  log->Debug( ExDbgMsg, "[%s] Destroying MsgHandler: 0x%x.",
229  pUrl.GetHostId().c_str(), this );
230  }
231 
232  //------------------------------------------------------------------------
238  //------------------------------------------------------------------------
239  virtual uint16_t Examine( std::shared_ptr<Message> &msg );
240 
241  //------------------------------------------------------------------------
250  //------------------------------------------------------------------------
251  virtual uint16_t InspectStatusRsp();
252 
253  //------------------------------------------------------------------------
257  //------------------------------------------------------------------------
258  virtual uint16_t GetSid() const;
259 
260  //------------------------------------------------------------------------
264  //------------------------------------------------------------------------
265  virtual void Process();
266 
267  //------------------------------------------------------------------------
277  //------------------------------------------------------------------------
279  Socket *socket,
280  uint32_t &bytesRead );
281 
282  //------------------------------------------------------------------------
288  //------------------------------------------------------------------------
289  virtual uint8_t OnStreamEvent( StreamEvent event,
290  XRootDStatus status );
291 
292  //------------------------------------------------------------------------
294  //------------------------------------------------------------------------
295  virtual void OnStatusReady( const Message *message,
296  XRootDStatus status );
297 
298  //------------------------------------------------------------------------
300  //------------------------------------------------------------------------
301  virtual bool IsRaw() const;
302 
303  //------------------------------------------------------------------------
312  //------------------------------------------------------------------------
314  uint32_t &bytesWritten );
315 
316  //------------------------------------------------------------------------
320  //------------------------------------------------------------------------
321  void WaitDone( time_t now );
322 
323  //------------------------------------------------------------------------
325  //------------------------------------------------------------------------
326  void SetExpiration( time_t expiration )
327  {
328  pExpiration = expiration;
329  }
330 
331  //------------------------------------------------------------------------
333  //------------------------------------------------------------------------
334  time_t GetExpiration()
335  {
336  return pExpiration;
337  }
338 
339  //------------------------------------------------------------------------
342  //------------------------------------------------------------------------
343  void SetRedirectAsAnswer( bool redirectAsAnswer )
344  {
345  pRedirectAsAnswer = redirectAsAnswer;
346  }
347 
348  //------------------------------------------------------------------------
351  //------------------------------------------------------------------------
352  void SetOksofarAsAnswer( bool oksofarAsAnswer )
353  {
354  pOksofarAsAnswer = oksofarAsAnswer;
355  }
356 
357  //------------------------------------------------------------------------
359  //------------------------------------------------------------------------
360  const Message *GetRequest() const
361  {
362  return pRequest;
363  }
364 
365  //------------------------------------------------------------------------
367  //------------------------------------------------------------------------
368  void SetLoadBalancer( const HostInfo &loadBalancer )
369  {
370  if( !loadBalancer.url.IsValid() )
371  return;
372  pLoadBalancer = loadBalancer;
373  pHasLoadBalancer = true;
374  }
375 
376  //------------------------------------------------------------------------
378  //------------------------------------------------------------------------
379  void SetHostList( HostList *hostList )
380  {
381  pHosts.reset( hostList );
382  }
383 
384  //------------------------------------------------------------------------
386  //------------------------------------------------------------------------
387  void SetChunkList( ChunkList *chunkList )
388  {
389  pChunkList = chunkList;
390  if( pVectorReader )
391  pVectorReader->SetChunkList( chunkList );
392  if( chunkList )
393  pChunkStatus.resize( chunkList->size() );
394  else
395  pChunkStatus.clear();
396  }
397 
398  void SetCrc32cDigests( std::vector<uint32_t> && crc32cDigests )
399  {
400  pCrc32cDigests = std::move( crc32cDigests );
401  }
402 
403  //------------------------------------------------------------------------
405  //------------------------------------------------------------------------
407  {
408  pKBuff = kbuff;
409  }
410 
411  //------------------------------------------------------------------------
413  //------------------------------------------------------------------------
414  void SetRedirectCounter( uint16_t redirectCounter )
415  {
416  pRedirectCounter = redirectCounter;
417  }
418 
419  void SetFollowMetalink( bool followMetalink )
420  {
421  pFollowMetalink = followMetalink;
422  }
423 
424  void SetStateful( bool stateful )
425  {
426  pStateful = stateful;
427  }
428 
429  //------------------------------------------------------------------------
433  //------------------------------------------------------------------------
435 
436  private:
437 
438  //------------------------------------------------------------------------
440  //------------------------------------------------------------------------
442  uint32_t &bytesRead );
443 
444  //------------------------------------------------------------------------
446  //------------------------------------------------------------------------
448  uint32_t &bytesRead );
449 
450  //------------------------------------------------------------------------
453  //------------------------------------------------------------------------
454  inline Status ReadAsync( Socket *socket, uint32_t &bytesRead )
455  {
456  uint32_t toBeRead = pAsyncReadSize - pAsyncOffset;
457  uint32_t btsRead = 0;
458  Status st = ReadBytesAsync( socket, pAsyncReadBuffer, toBeRead, btsRead );
459  pAsyncOffset += btsRead;
460  bytesRead += btsRead;
461  return st;
462  }
463 
464  //------------------------------------------------------------------------
466  //------------------------------------------------------------------------
467  static Status ReadBytesAsync( Socket *socket, char *&buffer,
468  uint32_t toBeRead, uint32_t &bytesRead );
469 
470  //------------------------------------------------------------------------
472  //------------------------------------------------------------------------
473  void HandleError( XRootDStatus status );
474 
475  //------------------------------------------------------------------------
477  //------------------------------------------------------------------------
478  Status RetryAtServer( const URL &url, RedirectEntry::Type entryType );
479 
480  //------------------------------------------------------------------------
482  //------------------------------------------------------------------------
484 
485  //------------------------------------------------------------------------
487  //------------------------------------------------------------------------
489 
490  //------------------------------------------------------------------------
493  //------------------------------------------------------------------------
495 
496  //------------------------------------------------------------------------
499  //------------------------------------------------------------------------
500  Status ParseXAttrResponse( char *data, size_t len, AnyObject *&response );
501 
502  //------------------------------------------------------------------------
505  //------------------------------------------------------------------------
507 
508  //------------------------------------------------------------------------
510  //------------------------------------------------------------------------
512 
513  //------------------------------------------------------------------------
515  //------------------------------------------------------------------------
516  void UpdateTriedCGI(uint32_t errNo=0);
517 
518  //------------------------------------------------------------------------
520  //------------------------------------------------------------------------
522 
523  //------------------------------------------------------------------------
526  //------------------------------------------------------------------------
528 
529  //------------------------------------------------------------------------
531  //------------------------------------------------------------------------
532  void HandleLocalRedirect( URL *url );
533 
534  //------------------------------------------------------------------------
539  //------------------------------------------------------------------------
540  bool IsRetriable();
541 
542  //------------------------------------------------------------------------
549  //------------------------------------------------------------------------
550  bool OmitWait( Message &request, const URL &url );
551 
552  //------------------------------------------------------------------------
558  //------------------------------------------------------------------------
559  bool RetriableErrorResponse( const Status &status );
560 
561  //------------------------------------------------------------------------
563  //------------------------------------------------------------------------
565 
572  //------------------------------------------------------------------------
573  template<typename T>
574  Status ReadFromBuffer( char *&buffer, size_t &buflen, T& result );
575 
576  //------------------------------------------------------------------------
583  //------------------------------------------------------------------------
584  Status ReadFromBuffer( char *&buffer, size_t &buflen, std::string &result );
585 
586  //------------------------------------------------------------------------
594  //------------------------------------------------------------------------
595  Status ReadFromBuffer( char *&buffer, size_t &buflen, size_t size,
596  std::string &result );
597 
598  //------------------------------------------------------------------------
599  // Helper struct for async reading of chunks
600  //------------------------------------------------------------------------
601  struct ChunkStatus
602  {
603  ChunkStatus(): sizeError( false ), done( false ) {}
604  bool sizeError;
605  bool done;
606  };
607 
608  typedef std::list<std::unique_ptr<RedirectEntry>> RedirectTraceBack;
609 
610  static const size_t CksumSize = sizeof( uint32_t );
611  static const size_t PageWithCksum = XrdSys::PageSize + CksumSize;
612  static const size_t MaxSslErrRetry = 3;
613 
614  inline static size_t NbPgPerRsp( uint64_t offset, uint32_t dlen )
615  {
616  uint32_t pgcnt = 0;
617  uint32_t remainder = offset % XrdSys::PageSize;
618  if( remainder > 0 )
619  {
620  // account for the first unaligned page
621  ++pgcnt;
622  // the size of the 1st unaligned page
623  uint32_t _1stpg = XrdSys::PageSize - remainder;
624  offset += _1stpg;
625  dlen -= _1stpg + CksumSize;
626  }
627  pgcnt += dlen / PageWithCksum;
628  if( dlen % PageWithCksum ) ++ pgcnt;
629  return pgcnt;
630  }
631 
633  std::shared_ptr<Message> pResponse; //< the ownership is shared with MsgReader
634  std::vector<std::shared_ptr<Message>> pPartialResps; //< the ownership is shared with MsgReader
639  std::shared_ptr<SIDManager> pSidMgr;
643  time_t pExpiration;
646  std::unique_ptr<HostList> pHosts;
650  std::string pRedirectUrl;
652  std::vector<uint32_t> pCrc32cDigests;
654  std::vector<ChunkStatus> pChunkStatus;
657 
658  uint32_t pAsyncOffset;
661  uint32_t pAsyncReadSize;
663  uint32_t pAsyncMsgSize;
664 
667 
668  std::unique_ptr<AsyncPageReader> pPageReader;
669  std::unique_ptr<AsyncVectorReader> pVectorReader;
670 
674 
676 
678 
679  bool pStateful;
681 
682  std::unique_ptr<RedirectEntry> pRdirEntry;
684 
685  bool pMsgInFly;
686 
687  //------------------------------------------------------------------------
688  // true if MsgHandler is both in inQueue and installed in respective
689  // Stream (this could happen if server gave oksofar response), otherwise
690  // false
691  //------------------------------------------------------------------------
692  std::atomic<bool> pTimeoutFence;
693 
694  //------------------------------------------------------------------------
695  // if we are serving chunked data to the user's handler in case of
696  // kXR_dirlist we need to memorize if the response contains stat info or
697  // not (the information is only encoded in the first chunk)
698  //------------------------------------------------------------------------
701 
702  //------------------------------------------------------------------------
703  // synchronization is needed in case the MsgHandler has been configured
704  // to serve kXR_oksofar as a response to the user's handler
705  //------------------------------------------------------------------------
707 
708  //------------------------------------------------------------------------
709  // Count of consecutive `errTlsSslError` errors
710  //------------------------------------------------------------------------
711  size_t pSslErrCnt;
712 
713  //------------------------------------------------------------------------
714  // Keep track if respective parts of kXR_status response have been
715  // unmarshaled.
716  //------------------------------------------------------------------------
719  };
720 }
721 
722 #endif // __XRD_CL_XROOTD_MSG_HANDLER_HH__
@ kXR_readv
Definition: XProtocol.hh:137
@ kXR_pgread
Definition: XProtocol.hh:142
Definition: XrdClAnyObject.hh:33
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:1117
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:115
void SetRedirectCounter(uint16_t redirectCounter)
Set the redirect counter.
Definition: XrdClXRootDMsgHandler.hh:414
Status ReadFromBuffer(char *&buffer, size_t &buflen, std::string &result)
bool pDirListStarted
Definition: XrdClXRootDMsgHandler.hh:699
bool pHasLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:647
XRootDStatus WriteMessageBody(Socket *socket, uint32_t &bytesWritten)
bool pMsgInFly
Definition: XrdClXRootDMsgHandler.hh:685
void SetFollowMetalink(bool followMetalink)
Definition: XrdClXRootDMsgHandler.hh:419
const Message * GetRequest() const
Get the request pointer.
Definition: XrdClXRootDMsgHandler.hh:360
bool pRspStatusBodyUnMarshaled
Definition: XrdClXRootDMsgHandler.hh:717
void SetChunkList(ChunkList *chunkList)
Set the chunk list.
Definition: XrdClXRootDMsgHandler.hh:387
uint32_t pAsyncReadSize
Definition: XrdClXRootDMsgHandler.hh:661
void SetHostList(HostList *hostList)
Set host list.
Definition: XrdClXRootDMsgHandler.hh:379
friend class HandleRspJob
Definition: XrdClXRootDMsgHandler.hh:116
uint16_t pNotAuthorizedCounter
Definition: XrdClXRootDMsgHandler.hh:656
ChunkList * pChunkList
Definition: XrdClXRootDMsgHandler.hh:651
std::unique_ptr< RedirectEntry > pRdirEntry
Definition: XrdClXRootDMsgHandler.hh:682
uint32_t pPgWrtCurrentPageOffset
Definition: XrdClXRootDMsgHandler.hh:672
virtual uint16_t InspectStatusRsp()
void SetCrc32cDigests(std::vector< uint32_t > &&crc32cDigests)
Definition: XrdClXRootDMsgHandler.hh:398
std::unique_ptr< AsyncVectorReader > pVectorReader
Definition: XrdClXRootDMsgHandler.hh:669
uint32_t pAsyncOffset
Definition: XrdClXRootDMsgHandler.hh:658
std::atomic< bool > pTimeoutFence
Definition: XrdClXRootDMsgHandler.hh:692
void HandleResponse()
Unpack the message and call the response handler.
static const size_t MaxSslErrRetry
Definition: XrdClXRootDMsgHandler.hh:612
static const size_t CksumSize
Definition: XrdClXRootDMsgHandler.hh:610
uint32_t pReadRawCurrentOffset
Definition: XrdClXRootDMsgHandler.hh:666
XRootDStatus * ProcessStatus()
Extract the status information from the stuff that we got.
HostInfo pLoadBalancer
Definition: XrdClXRootDMsgHandler.hh:648
void UpdateTriedCGI(uint32_t errNo=0)
Update the "tried=" part of the CGI of the current message.
bool pOtherRawStarted
Definition: XrdClXRootDMsgHandler.hh:675
LocalFileHandler * pLFileHandler
Definition: XrdClXRootDMsgHandler.hh:640
void SetLoadBalancer(const HostInfo &loadBalancer)
Set the load balancer.
Definition: XrdClXRootDMsgHandler.hh:368
static Status ReadBytesAsync(Socket *socket, char *&buffer, uint32_t toBeRead, uint32_t &bytesRead)
Read a buffer asynchronously.
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)
Status ReadAsync(Socket *socket, uint32_t &bytesRead)
Definition: XrdClXRootDMsgHandler.hh:454
static size_t NbPgPerRsp(uint64_t offset, uint32_t dlen)
Definition: XrdClXRootDMsgHandler.hh:614
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:637
std::vector< ChunkStatus > pChunkStatus
Definition: XrdClXRootDMsgHandler.hh:654
bool pReadRawStarted
Definition: XrdClXRootDMsgHandler.hh:665
std::string pRedirectUrl
Definition: XrdClXRootDMsgHandler.hh:650
XRootDMsgHandler(Message *msg, ResponseHandler *respHandler, const URL *url, std::shared_ptr< SIDManager > sidMgr, LocalFileHandler *lFileHandler)
Definition: XrdClXRootDMsgHandler.hh:129
bool pOksofarAsAnswer
Definition: XrdClXRootDMsgHandler.hh:645
RedirectTraceBack pRedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:683
bool pDirListWithStat
Definition: XrdClXRootDMsgHandler.hh:700
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:680
std::shared_ptr< SIDManager > pSidMgr
Definition: XrdClXRootDMsgHandler.hh:639
~XRootDMsgHandler()
Destructor.
Definition: XrdClXRootDMsgHandler.hh:212
PostMaster * pPostMaster
Definition: XrdClXRootDMsgHandler.hh:638
std::unique_ptr< AsyncPageReader > pPageReader
Definition: XrdClXRootDMsgHandler.hh:668
void WaitDone(time_t now)
Status ReadRawRead(Socket *socket, uint32_t &bytesRead)
Handle a kXR_read in raw mode.
std::vector< uint32_t > pCrc32cDigests
Definition: XrdClXRootDMsgHandler.hh:652
size_t pSslErrCnt
Definition: XrdClXRootDMsgHandler.hh:711
Status RewriteRequestRedirect(const URL &newUrl)
void SetStateful(bool stateful)
Definition: XrdClXRootDMsgHandler.hh:424
bool pStateful
Definition: XrdClXRootDMsgHandler.hh:679
time_t GetExpiration()
Get a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:334
std::shared_ptr< Message > pResponse
Definition: XrdClXRootDMsgHandler.hh:633
char * pAsyncReadBuffer
Definition: XrdClXRootDMsgHandler.hh:662
virtual uint8_t OnStreamEvent(StreamEvent event, XRootDStatus status)
XrdSys::KernelBuffer * pKBuff
Definition: XrdClXRootDMsgHandler.hh:653
bool pRspPgWrtRetrnsmReqUnMarshalled
Definition: XrdClXRootDMsgHandler.hh:718
bool pFollowMetalink
Definition: XrdClXRootDMsgHandler.hh:677
time_t pExpiration
Definition: XrdClXRootDMsgHandler.hh:643
Status RetryAtServer(const URL &url, RedirectEntry::Type entryType)
Retry the request at another server.
uint16_t pRedirectCounter
Definition: XrdClXRootDMsgHandler.hh:655
std::vector< std::shared_ptr< Message > > pPartialResps
Definition: XrdClXRootDMsgHandler.hh:634
Status ReadRawOther(Socket *socket, uint32_t &bytesRead)
Handle anything other than kXR_read and kXR_readv in raw mode.
Message * pRequest
Definition: XrdClXRootDMsgHandler.hh:632
static const size_t PageWithCksum
Definition: XrdClXRootDMsgHandler.hh:611
uint32_t pPgWrtCurrentPageNb
Definition: XrdClXRootDMsgHandler.hh:673
void SetOksofarAsAnswer(bool oksofarAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:352
virtual XRootDStatus ReadMessageBody(Message *msg, Socket *socket, uint32_t &bytesRead)
void SetKernelBuffer(XrdSys::KernelBuffer *kbuff)
Set the kernel buffer.
Definition: XrdClXRootDMsgHandler.hh:406
bool pHasSessionId
Definition: XrdClXRootDMsgHandler.hh:649
uint32_t pAsyncMsgSize
Definition: XrdClXRootDMsgHandler.hh:663
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:636
std::unique_ptr< HostList > pHosts
Definition: XrdClXRootDMsgHandler.hh:646
uint32_t pAsyncChunkOffset
Definition: XrdClXRootDMsgHandler.hh:659
Status ParseXAttrResponse(char *data, size_t len, AnyObject *&response)
XrdSysCondVar pCV
Definition: XrdClXRootDMsgHandler.hh:706
ResponseHandler * pResponseHandler
Definition: XrdClXRootDMsgHandler.hh:635
Status pLastError
Definition: XrdClXRootDMsgHandler.hh:642
XRootDStatus pStatus
Definition: XrdClXRootDMsgHandler.hh:641
std::list< std::unique_ptr< RedirectEntry > > RedirectTraceBack
Definition: XrdClXRootDMsgHandler.hh:608
void SetExpiration(time_t expiration)
Set a timestamp after which we give up.
Definition: XrdClXRootDMsgHandler.hh:326
bool pRedirectAsAnswer
Definition: XrdClXRootDMsgHandler.hh:644
Buffer pPgWrtCksumBuff
Definition: XrdClXRootDMsgHandler.hh:671
void SetRedirectAsAnswer(bool redirectAsAnswer)
Definition: XrdClXRootDMsgHandler.hh:343
uint32_t pAsyncChunkIndex
Definition: XrdClXRootDMsgHandler.hh:660
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: XrdClAnyObject.hh:26
std::vector< HostInfo > HostList
Definition: XrdClXRootDResponses.hh:1111
const uint64_t ExDbgMsg
Definition: XrdClConstants.hh:44
std::vector< ChunkInfo > ChunkList
List of chunks.
Definition: XrdClXRootDResponses.hh:1046
static const int PageSize
Definition: XrdSysPageSize.hh:36
Definition: XProtocol.hh:501
kXR_int32 rlen
Definition: XProtocol.hh:506
kXR_int64 offset
Definition: XProtocol.hh:505
Definition: XProtocol.hh:155
kXR_unt16 requestid
Definition: XProtocol.hh:157
Definition: XrdClXRootDResponses.hh:1100
URL url
URL of the host.
Definition: XrdClXRootDResponses.hh:1108
Definition: XrdClXRootDMsgHandler.hh:66
Type type
Definition: XrdClXRootDMsgHandler.hh:83
RedirectEntry(const URL &from, const URL &to, Type type)
Definition: XrdClXRootDMsgHandler.hh:75
XRootDStatus status
Definition: XrdClXRootDMsgHandler.hh:84
URL from
Definition: XrdClXRootDMsgHandler.hh:81
std::string ToString(bool prevok=true)
Definition: XrdClXRootDMsgHandler.hh:86
URL to
Definition: XrdClXRootDMsgHandler.hh:82
Type
Definition: XrdClXRootDMsgHandler.hh:68
@ EntryRedirect
Definition: XrdClXRootDMsgHandler.hh:69
@ EntryRetry
Definition: XrdClXRootDMsgHandler.hh:71
@ EntryRedirectOnWait
Definition: XrdClXRootDMsgHandler.hh:70
@ EntryWait
Definition: XrdClXRootDMsgHandler.hh:72
Procedure execution status.
Definition: XrdClStatus.hh:114
Definition: XrdClXRootDMsgHandler.hh:602
ChunkStatus()
Definition: XrdClXRootDMsgHandler.hh:603
bool sizeError
Definition: XrdClXRootDMsgHandler.hh:604
bool done
Definition: XrdClXRootDMsgHandler.hh:605