diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/tools/immutable_object_cache/CacheSession.h | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/immutable_object_cache/CacheSession.h')
-rw-r--r-- | src/tools/immutable_object_cache/CacheSession.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/tools/immutable_object_cache/CacheSession.h b/src/tools/immutable_object_cache/CacheSession.h new file mode 100644 index 000000000..0826e8a2b --- /dev/null +++ b/src/tools/immutable_object_cache/CacheSession.h @@ -0,0 +1,56 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#ifndef CEPH_CACHE_SESSION_H +#define CEPH_CACHE_SESSION_H + +#include <boost/asio.hpp> +#include <boost/asio/error.hpp> + +#include "Types.h" +#include "SocketCommon.h" + +using boost::asio::local::stream_protocol; +using boost::asio::io_service; + +namespace ceph { +namespace immutable_obj_cache { + +class CacheSession : public std::enable_shared_from_this<CacheSession> { + public: + CacheSession(io_service& io_service, ProcessMsg process_msg, + CephContext* ctx); + ~CacheSession(); + stream_protocol::socket& socket(); + void close(); + void start(); + void read_request_header(); + void handle_request_header(const boost::system::error_code& err, + size_t bytes_transferred); + void read_request_data(uint64_t data_len); + void handle_request_data(bufferptr bp, uint64_t data_len, + const boost::system::error_code& err, + size_t bytes_transferred); + void process(ObjectCacheRequest* req); + void fault(const boost::system::error_code& ec); + void send(ObjectCacheRequest* msg); + + void set_client_version(const std::string &version); + const std::string &client_version() const; + + private: + stream_protocol::socket m_dm_socket; + ProcessMsg m_server_process_msg; + CephContext* m_cct; + + std::string m_client_version; + + bufferptr m_bp_header; +}; + +typedef std::shared_ptr<CacheSession> CacheSessionPtr; + +} // namespace immutable_obj_cache +} // namespace ceph + +#endif // CEPH_CACHE_SESSION_H |