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