1 From c769c9238ad62178f506038178714a1c35aa2769 Mon Sep 17 00:00:00 2001
2 From: Stefan Floeren <42731906+stefan-floeren@users.noreply.github.com>
3 Date: Tue, 16 Apr 2019 08:38:01 +0200
4 Subject: [PATCH] Replace make_shared with new in some cases
6 Replace make_shared for asio types that take a lib::ref as a parameter.
7 This should fix the ASIO change (boostorg/asio@59066d8) for 1.70,
8 while keeping it backwards compatible to older boost versions.
10 websocketpp/transport/asio/connection.hpp | 7 ++++---
11 websocketpp/transport/asio/endpoint.hpp | 3 +--
12 websocketpp/transport/asio/security/none.hpp | 3 +--
13 websocketpp/transport/asio/security/tls.hpp | 3 +--
14 4 files changed, 7 insertions(+), 9 deletions(-)
16 diff -urNp -x '*.orig' pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/connection.hpp pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/connection.hpp
17 --- pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/connection.hpp 2017-08-16 14:24:03.000000000 +0200
18 +++ pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/connection.hpp 2021-08-22 09:36:02.780556636 +0200
19 @@ -311,9 +311,10 @@ public:
22 timer_ptr set_timer(long duration, timer_handler callback) {
23 - timer_ptr new_timer = lib::make_shared<lib::asio::steady_timer>(
24 - lib::ref(*m_io_service),
25 - lib::asio::milliseconds(duration)
26 + timer_ptr new_timer(
27 + new lib::asio::steady_timer(
29 + lib::asio::milliseconds(duration))
32 if (config::enable_multithreading) {
33 diff -urNp -x '*.orig' pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/endpoint.hpp pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/endpoint.hpp
34 --- pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/endpoint.hpp 2017-08-16 14:24:03.000000000 +0200
35 +++ pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/endpoint.hpp 2021-08-22 09:36:02.780556636 +0200
36 @@ -191,8 +191,7 @@ public:
39 m_external_io_service = true;
40 - m_acceptor = lib::make_shared<lib::asio::ip::tcp::acceptor>(
41 - lib::ref(*m_io_service));
42 + m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service));
45 ec = lib::error_code();
46 diff -urNp -x '*.orig' pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/security/none.hpp pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/security/none.hpp
47 --- pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/security/none.hpp 2017-08-16 14:24:03.000000000 +0200
48 +++ pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/security/none.hpp 2021-08-22 09:36:02.780556636 +0200
49 @@ -168,8 +168,7 @@ protected:
50 return socket::make_error_code(socket::error::invalid_state);
53 - m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
54 - lib::ref(*service));
55 + m_socket.reset(new lib::asio::ip::tcp::socket(*service));
59 diff -urNp -x '*.orig' pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/security/tls.hpp pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/security/tls.hpp
60 --- pokerth-1.1.2-rc.org/src/third_party/websocketpp/websocketpp/transport/asio/security/tls.hpp 2017-08-16 14:24:03.000000000 +0200
61 +++ pokerth-1.1.2-rc/src/third_party/websocketpp/websocketpp/transport/asio/security/tls.hpp 2021-08-22 09:36:02.780556636 +0200
62 @@ -193,8 +193,7 @@ protected:
64 return socket::make_error_code(socket::error::invalid_tls_context);
66 - m_socket = lib::make_shared<socket_type>(
67 - _WEBSOCKETPP_REF(*service),lib::ref(*m_context));
68 + m_socket.reset(new socket_type(*service, *m_context));
70 m_io_service = service;