XRootD
XrdClAsyncDiscardReader.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3 // Author: Michal Simon <michal.simon@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef SRC_XRDCL_XRDCLASYNCDISCARDREADER_HH_
20 #define SRC_XRDCL_XRDCLASYNCDISCARDREADER_HH_
21 
23 #include "XrdCl/XrdClSocket.hh"
24 #include "XrdCl/XrdClDefaultEnv.hh"
25 #include "XrdCl/XrdClLog.hh"
26 #include "XrdCl/XrdClConstants.hh"
28 
29 namespace XrdCl
30 {
31 
32  //----------------------------------------------------------------------------
34  //----------------------------------------------------------------------------
36  {
37  public:
38  //------------------------------------------------------------------------
43  //------------------------------------------------------------------------
46  {
47  }
48 
49  //------------------------------------------------------------------------
55  //------------------------------------------------------------------------
56  XRootDStatus Read( Socket &socket, uint32_t &btsret )
57  {
58  Log *log = DefaultEnv::GetLog();
59  log->Error( XRootDMsg, "[%s] Handling response to %s: "
60  "DiscardReader: we were not expecting "
61  "raw data.", url.GetHostId().c_str(),
63  // Just drop the connection, we don't know if the stream is sane anymore.
64  // Recover with a reconnect.
66  }
67 
68  //------------------------------------------------------------------------
71  //------------------------------------------------------------------------
73  {
74  response = nullptr;
76  }
77  };
78 
79 } /* namespace XrdCl */
80 
81 #endif /* SRC_XRDCL_XRDCLASYNCVECTORREADER_HH_ */
Object for discarding data.
XRootDStatus GetResponse(AnyObject *&response)
XRootDStatus Read(Socket &socket, uint32_t &btsret)
AsyncDiscardReader(const URL &url, const Message &request)
Base class for any message's body reader.
static Log * GetLog()
Get default log.
Handle diagnostics.
Definition: XrdClLog.hh:101
void Error(uint64_t topic, const char *format,...)
Report an error.
Definition: XrdClLog.cc:231
The message representation used throughout the system.
Definition: XrdClMessage.hh:32
const std::string & GetObfuscatedDescription() const
Get the description of the message with authz parameter obfuscated.
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:99
const uint16_t stError
An error occurred that could potentially be retried.
Definition: XrdClStatus.hh:32
const uint64_t XRootDMsg
const uint16_t errInvalidResponse
Definition: XrdClStatus.hh:99
const uint16_t errCorruptedHeader
Definition: XrdClStatus.hh:103