mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 06:32:36 +00:00
Fixed Boost 1.70 compatibility to restore macOS compile.
Manually applied this patch: https://github.com/zaphoyd/websocketpp/pull/814
This commit is contained in:
parent
eaca4ea7c0
commit
21c28ffd6b
@ -120,7 +120,7 @@ public:
|
||||
* Called by the endpoint as a connection is being established to provide
|
||||
* the uri being connected to to the transport layer.
|
||||
*
|
||||
* This transport policy doesn't use the uri except to forward it to the
|
||||
* This transport policy doesn't use the uri except to forward it to the
|
||||
* socket layer.
|
||||
*
|
||||
* @since 0.6.0
|
||||
@ -311,10 +311,10 @@ public:
|
||||
* needed.
|
||||
*/
|
||||
timer_ptr set_timer(long duration, timer_handler callback) {
|
||||
timer_ptr new_timer = lib::make_shared<lib::asio::steady_timer>(
|
||||
lib::ref(*m_io_service),
|
||||
lib::asio::milliseconds(duration)
|
||||
);
|
||||
timer_ptr new_timer(
|
||||
new lib::asio::steady_timer(
|
||||
*m_io_service,
|
||||
lib::asio::milliseconds(duration)));
|
||||
|
||||
if (config::enable_multithreading) {
|
||||
new_timer->async_wait(m_strand->wrap(lib::bind(
|
||||
@ -375,14 +375,14 @@ public:
|
||||
* Primarily used if you are using mismatched asio / system_error
|
||||
* implementations such as `boost::asio` with `std::system_error`. In these
|
||||
* cases the transport error type is different than the library error type
|
||||
* and some WebSocket++ functions that return transport errors via the
|
||||
* and some WebSocket++ functions that return transport errors via the
|
||||
* library error code type will be coerced into a catch all `pass_through`
|
||||
* or `tls_error` error. This method will return the original machine
|
||||
* or `tls_error` error. This method will return the original machine
|
||||
* readable transport error in the native type.
|
||||
*
|
||||
* @since 0.7.0
|
||||
*
|
||||
* @return Error code indicating the reason the connection was closed or
|
||||
* @return Error code indicating the reason the connection was closed or
|
||||
* failed
|
||||
*/
|
||||
lib::asio::error_code get_transport_ec() const {
|
||||
@ -461,8 +461,7 @@ protected:
|
||||
m_io_service = io_service;
|
||||
|
||||
if (config::enable_multithreading) {
|
||||
m_strand = lib::make_shared<lib::asio::io_service::strand>(
|
||||
lib::ref(*io_service));
|
||||
m_strand.reset(new lib::asio::io_service::strand(*io_service));
|
||||
}
|
||||
|
||||
lib::error_code ec = socket_con_type::init_asio(io_service, m_strand,
|
||||
@ -499,7 +498,7 @@ protected:
|
||||
}
|
||||
|
||||
timer_ptr post_timer;
|
||||
|
||||
|
||||
if (config::timeout_socket_post_init > 0) {
|
||||
post_timer = set_timer(
|
||||
config::timeout_socket_post_init,
|
||||
@ -863,9 +862,9 @@ protected:
|
||||
lib::placeholders::_1, lib::placeholders::_2
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void handle_async_read(read_handler handler, lib::asio::error_code const & ec,
|
||||
@ -1067,7 +1066,7 @@ protected:
|
||||
* @param callback The function to call back
|
||||
* @param ec The status code
|
||||
*/
|
||||
void handle_async_shutdown_timeout(timer_ptr, init_handler callback,
|
||||
void handle_async_shutdown_timeout(timer_ptr, init_handler callback,
|
||||
lib::error_code const & ec)
|
||||
{
|
||||
lib::error_code ret_ec;
|
||||
|
@ -157,7 +157,7 @@ public:
|
||||
rhs.m_acceptor = NULL;
|
||||
rhs.m_listen_backlog = lib::asio::socket_base::max_connections;
|
||||
rhs.m_state = UNINITIALIZED;
|
||||
|
||||
|
||||
// TODO: this needs to be updated
|
||||
}
|
||||
return *this;
|
||||
@ -191,8 +191,7 @@ public:
|
||||
|
||||
m_io_service = ptr;
|
||||
m_external_io_service = true;
|
||||
m_acceptor = lib::make_shared<lib::asio::ip::tcp::acceptor>(
|
||||
lib::ref(*m_io_service));
|
||||
m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service));
|
||||
|
||||
m_state = READY;
|
||||
ec = lib::error_code();
|
||||
@ -222,7 +221,7 @@ public:
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
void init_asio(lib::error_code & ec) {
|
||||
// Use a smart pointer until the call is successful and ownership has
|
||||
// Use a smart pointer until the call is successful and ownership has
|
||||
// successfully been taken. Use unique_ptr when available.
|
||||
// TODO: remove the use of auto_ptr when C++98/03 support is no longer
|
||||
// necessary.
|
||||
@ -244,7 +243,7 @@ public:
|
||||
* @see init_asio(io_service_ptr ptr)
|
||||
*/
|
||||
void init_asio() {
|
||||
// Use a smart pointer until the call is successful and ownership has
|
||||
// Use a smart pointer until the call is successful and ownership has
|
||||
// successfully been taken. Use unique_ptr when available.
|
||||
// TODO: remove the use of auto_ptr when C++98/03 support is no longer
|
||||
// necessary.
|
||||
@ -357,7 +356,7 @@ public:
|
||||
lib::asio::io_service & get_io_service() {
|
||||
return *m_io_service;
|
||||
}
|
||||
|
||||
|
||||
/// Get local TCP endpoint
|
||||
/**
|
||||
* Extracts the local endpoint from the acceptor. This represents the
|
||||
@ -365,7 +364,7 @@ public:
|
||||
*
|
||||
* Sets a bad_descriptor error if the acceptor is not currently listening
|
||||
* or otherwise unavailable.
|
||||
*
|
||||
*
|
||||
* @since 0.7.0
|
||||
*
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
@ -660,9 +659,7 @@ public:
|
||||
* @since 0.3.0
|
||||
*/
|
||||
void start_perpetual() {
|
||||
m_work = lib::make_shared<lib::asio::io_service::work>(
|
||||
lib::ref(*m_io_service)
|
||||
);
|
||||
m_work.reset(new lib::asio::io_service::work(*m_io_service));
|
||||
}
|
||||
|
||||
/// Clears the endpoint's perpetual flag, allowing it to exit when empty
|
||||
@ -800,7 +797,7 @@ protected:
|
||||
m_elog = e;
|
||||
}
|
||||
|
||||
void handle_accept(accept_handler callback, lib::asio::error_code const &
|
||||
void handle_accept(accept_handler callback, lib::asio::error_code const &
|
||||
asio_ec)
|
||||
{
|
||||
lib::error_code ret_ec;
|
||||
@ -826,8 +823,7 @@ protected:
|
||||
|
||||
// Create a resolver
|
||||
if (!m_resolver) {
|
||||
m_resolver = lib::make_shared<lib::asio::ip::tcp::resolver>(
|
||||
lib::ref(*m_io_service));
|
||||
m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service));
|
||||
}
|
||||
|
||||
tcon->set_uri(u);
|
||||
|
@ -168,8 +168,7 @@ protected:
|
||||
return socket::make_error_code(socket::error::invalid_state);
|
||||
}
|
||||
|
||||
m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
|
||||
lib::ref(*service));
|
||||
m_socket.reset(new lib::asio::ip::tcp::socket(*service));
|
||||
|
||||
m_state = READY;
|
||||
|
||||
@ -263,14 +262,14 @@ protected:
|
||||
|
||||
/// Translate any security policy specific information about an error code
|
||||
/**
|
||||
* Translate_ec takes an Asio error code and attempts to convert its value
|
||||
* Translate_ec takes an Asio error code and attempts to convert its value
|
||||
* to an appropriate websocketpp error code. In the case that the Asio and
|
||||
* Websocketpp error types are the same (such as using boost::asio and
|
||||
* boost::system_error or using standalone asio and std::system_error the
|
||||
* code will be passed through natively.
|
||||
*
|
||||
* In the case of a mismatch (boost::asio with std::system_error) a
|
||||
* translated code will be returned. The plain socket policy does not have
|
||||
* translated code will be returned. The plain socket policy does not have
|
||||
* any additional information so all such errors will be reported as the
|
||||
* generic transport pass_through error.
|
||||
*
|
||||
@ -284,8 +283,8 @@ protected:
|
||||
// We don't know any more information about this error so pass through
|
||||
return make_error_code(transport::error::pass_through);
|
||||
}
|
||||
|
||||
/// Overload of translate_ec to catch cases where lib::error_code is the
|
||||
|
||||
/// Overload of translate_ec to catch cases where lib::error_code is the
|
||||
/// same type as lib::asio::error_code
|
||||
lib::error_code translate_ec(lib::error_code ec) {
|
||||
// We don't know any more information about this error, but the error is
|
||||
|
@ -193,8 +193,7 @@ protected:
|
||||
if (!m_context) {
|
||||
return socket::make_error_code(socket::error::invalid_tls_context);
|
||||
}
|
||||
m_socket = lib::make_shared<socket_type>(
|
||||
_WEBSOCKETPP_REF(*service),lib::ref(*m_context));
|
||||
m_socket.reset(new socket_type(*service, *m_context));
|
||||
|
||||
m_io_service = service;
|
||||
m_strand = strand;
|
||||
@ -229,7 +228,7 @@ protected:
|
||||
* @param callback Handler to call back with completion information
|
||||
*/
|
||||
void pre_init(init_handler callback) {
|
||||
// TODO: is this the best way to check whether this function is
|
||||
// TODO: is this the best way to check whether this function is
|
||||
// available in the version of OpenSSL being used?
|
||||
// TODO: consider case where host is an IP address
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x90812f
|
||||
@ -368,11 +367,11 @@ protected:
|
||||
return make_error_code(transport::error::pass_through);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Overload of translate_ec to catch cases where lib::error_code is the
|
||||
/// same type as lib::asio::error_code
|
||||
lib::error_code translate_ec(lib::error_code ec) {
|
||||
// Normalize the tls_short_read error as it is used by the library and
|
||||
// Normalize the tls_short_read error as it is used by the library and
|
||||
// needs a consistent value. All other errors pass through natively.
|
||||
// TODO: how to get the SSL category from std::error?
|
||||
/*if (ec.category() == lib::asio::error::get_ssl_category()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user