aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/asio_tls_server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/asio_tls_server.cpp')
-rw-r--r--doc/examples/asio_tls_server.cpp39
1 files changed, 2 insertions, 37 deletions
diff --git a/doc/examples/asio_tls_server.cpp b/doc/examples/asio_tls_server.cpp
index fff83f5f8..efd150cae 100644
--- a/doc/examples/asio_tls_server.cpp
+++ b/doc/examples/asio_tls_server.cpp
@@ -186,41 +186,6 @@ class tls_server_session : public boost::enable_shared_from_this<tls_server_sess
std::vector<byte> m_outbox;
};
-class Session_Manager_Locked : public Botan::TLS::Session_Manager
- {
- public:
- bool load_from_session_id(const Botan::MemoryRegion<byte>& session_id,
- Botan::TLS::Session& session)
- {
- boost::lock_guard<boost::mutex> lock(m_mutex);
- return m_session_manager.load_from_session_id(session_id, session);
- }
-
- bool load_from_host_info(const std::string& hostname, Botan::u16bit port,
- Botan::TLS::Session& session)
- {
- boost::lock_guard<boost::mutex> lock(m_mutex);
- return m_session_manager.load_from_host_info(hostname, port, session);
- };
-
- void remove_entry(const Botan::MemoryRegion<byte>& session_id)
- {
- boost::lock_guard<boost::mutex> lock(m_mutex);
- m_session_manager.remove_entry(session_id);
- }
-
- void save(const Botan::TLS::Session& session)
- {
- boost::lock_guard<boost::mutex> lock(m_mutex);
- m_session_manager.save(session);
- }
-
- private:
- boost::mutex m_mutex;
- Botan::TLS::Session_Manager_In_Memory m_session_manager;
-
- };
-
class tls_server
{
public:
@@ -277,7 +242,7 @@ class tls_server
tcp::acceptor m_acceptor;
Botan::AutoSeeded_RNG m_rng;
- Session_Manager_Locked m_session_manager;
+ Botan::TLS::Session_Manager_In_Memory m_session_manager;
Botan::TLS::Policy m_policy;
Credentials_Manager_Simple m_creds;
};
@@ -299,7 +264,7 @@ int main()
std::cout << "Using " << num_threads << " threads\n";
- std::vector<boost::shared_ptr<boost::thread> > threads;
+ std::vector<boost::shared_ptr<boost::thread>> threads;
for(size_t i = 0; i != num_threads; ++i)
{