mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 13:21:13 +00:00
Fixed Raspberry Pi compile.
This commit is contained in:
parent
19c4d2ae22
commit
b1dc082947
@ -234,7 +234,7 @@ void connection<config>::handle_pong_timeout(std::string payload,
|
||||
lib::error_code const & ec)
|
||||
{
|
||||
if (ec) {
|
||||
if (ec == transport::error::operation_aborted) {
|
||||
if (ec.value() == (int) transport::error::operation_aborted) {
|
||||
// ignore, this is expected
|
||||
return;
|
||||
}
|
||||
@ -828,7 +828,7 @@ void connection<config>::handle_read_handshake(lib::error_code const & ec,
|
||||
}
|
||||
|
||||
if (ecm) {
|
||||
if (ecm == transport::error::eof && m_state == session::state::closed) {
|
||||
if (ecm.value() == (int) transport::error::eof && m_state == session::state::closed) {
|
||||
// we expect to get eof if the connection is closed already
|
||||
m_alog.write(log::alevel::devel,
|
||||
"got (expected) eof/state error from closed con");
|
||||
@ -976,7 +976,7 @@ void connection<config>::handle_read_frame(lib::error_code const & ec,
|
||||
if (ecm) {
|
||||
log::level echannel = log::elevel::rerror;
|
||||
|
||||
if (ecm == transport::error::eof) {
|
||||
if (ecm.value() == (int) transport::error::eof) {
|
||||
if (m_state == session::state::closed) {
|
||||
// we expect to get eof if the connection is closed already
|
||||
// just ignore it
|
||||
@ -989,7 +989,7 @@ void connection<config>::handle_read_frame(lib::error_code const & ec,
|
||||
terminate(lib::error_code());
|
||||
return;
|
||||
}
|
||||
} else if (ecm == error::invalid_state) {
|
||||
} else if (ecm.value() == (int) error::invalid_state) {
|
||||
// In general, invalid state errors in the closed state are the
|
||||
// result of handlers that were in the system already when the state
|
||||
// changed and should be ignored as they pose no problems and there
|
||||
@ -999,7 +999,7 @@ void connection<config>::handle_read_frame(lib::error_code const & ec,
|
||||
"handle_read_frame: got invalid istate in closed state");
|
||||
return;
|
||||
}
|
||||
} else if (ecm == transport::error::tls_short_read) {
|
||||
} else if (ecm.value() == (int) transport::error::tls_short_read) {
|
||||
if (m_state == session::state::closed) {
|
||||
// We expect to get a TLS short read if we try to read after the
|
||||
// connection is closed. If this happens ignore and exit the
|
||||
@ -1008,7 +1008,7 @@ void connection<config>::handle_read_frame(lib::error_code const & ec,
|
||||
return;
|
||||
}
|
||||
echannel = log::elevel::rerror;
|
||||
} else if (ecm == transport::error::action_after_shutdown) {
|
||||
} else if (ecm.value() == (int) transport::error::action_after_shutdown) {
|
||||
echannel = log::elevel::info;
|
||||
}
|
||||
|
||||
@ -1370,7 +1370,7 @@ void connection<config>::handle_write_http_response(lib::error_code const & ec)
|
||||
}
|
||||
|
||||
if (ecm) {
|
||||
if (ecm == transport::error::eof && m_state == session::state::closed) {
|
||||
if (ecm.value() == (int) transport::error::eof && m_state == session::state::closed) {
|
||||
// we expect to get eof if the connection is closed already
|
||||
m_alog.write(log::alevel::devel,
|
||||
"got (expected) eof/state error from closed con");
|
||||
@ -1514,7 +1514,7 @@ void connection<config>::handle_send_http_request(lib::error_code const & ec) {
|
||||
}
|
||||
|
||||
if (ecm) {
|
||||
if (ecm == transport::error::eof && m_state == session::state::closed) {
|
||||
if (ecm.value() == (int) transport::error::eof && m_state == session::state::closed) {
|
||||
// we expect to get eof if the connection is closed already
|
||||
m_alog.write(log::alevel::devel,
|
||||
"got (expected) eof/state error from closed con");
|
||||
@ -1567,7 +1567,7 @@ void connection<config>::handle_read_http_response(lib::error_code const & ec,
|
||||
}
|
||||
|
||||
if (ecm) {
|
||||
if (ecm == transport::error::eof && m_state == session::state::closed) {
|
||||
if (ecm.value() == (int) transport::error::eof && m_state == session::state::closed) {
|
||||
// we expect to get eof if the connection is closed already
|
||||
m_alog.write(log::alevel::devel,
|
||||
"got (expected) eof/state error from closed con");
|
||||
@ -1663,7 +1663,7 @@ template <typename config>
|
||||
void connection<config>::handle_open_handshake_timeout(
|
||||
lib::error_code const & ec)
|
||||
{
|
||||
if (ec == transport::error::operation_aborted) {
|
||||
if (ec.value() == (int) transport::error::operation_aborted) {
|
||||
m_alog.write(log::alevel::devel,"open handshake timer cancelled");
|
||||
} else if (ec) {
|
||||
m_alog.write(log::alevel::devel,
|
||||
@ -1679,7 +1679,7 @@ template <typename config>
|
||||
void connection<config>::handle_close_handshake_timeout(
|
||||
lib::error_code const & ec)
|
||||
{
|
||||
if (ec == transport::error::operation_aborted) {
|
||||
if (ec.value() == (int) transport::error::operation_aborted) {
|
||||
m_alog.write(log::alevel::devel,"asio close handshake timer cancelled");
|
||||
} else if (ec) {
|
||||
m_alog.write(log::alevel::devel,
|
||||
@ -1720,7 +1720,7 @@ void connection<config>::terminate(lib::error_code const & ec) {
|
||||
|
||||
// Log fail result here before socket is shut down and we can't get
|
||||
// the remote address, etc anymore
|
||||
if (m_ec != error::http_connection_ended) {
|
||||
if (m_ec.value() != (int) error::http_connection_ended) {
|
||||
log_fail_result();
|
||||
}
|
||||
} else if (m_state != session::state::closed) {
|
||||
@ -1759,7 +1759,7 @@ void connection<config>::handle_terminate(terminate_status tstat,
|
||||
|
||||
// clean shutdown
|
||||
if (tstat == failed) {
|
||||
if (m_ec != error::http_connection_ended) {
|
||||
if (m_ec.value() != (int) error::http_connection_ended) {
|
||||
if (m_fail_handler) {
|
||||
m_fail_handler(m_connection_hdl);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
if (ec) {
|
||||
con->terminate(ec);
|
||||
|
||||
if (ec == error::operation_canceled) {
|
||||
if (ec.value() == (int) error::operation_canceled) {
|
||||
endpoint_type::m_elog.write(log::elevel::info,
|
||||
"handle_accept error: "+ec.message());
|
||||
} else {
|
||||
@ -175,7 +175,7 @@ public:
|
||||
|
||||
lib::error_code start_ec;
|
||||
start_accept(start_ec);
|
||||
if (start_ec == error::async_accept_not_listening) {
|
||||
if (start_ec.value() == (int) error::async_accept_not_listening) {
|
||||
endpoint_type::m_elog.write(log::elevel::info,
|
||||
"Stopping acceptance of new connections because the underlying transport is no longer listening.");
|
||||
} else if (start_ec) {
|
||||
|
@ -350,7 +350,7 @@ public:
|
||||
lib::asio::error_code const & ec)
|
||||
{
|
||||
if (ec) {
|
||||
if (ec == lib::asio::error::operation_aborted) {
|
||||
if (ec.value() == (int) lib::asio::error::operation_aborted) {
|
||||
callback(make_error_code(transport::error::operation_aborted));
|
||||
} else {
|
||||
log_err(log::elevel::info,"asio handle_timer",ec);
|
||||
@ -539,7 +539,7 @@ protected:
|
||||
lib::error_code ret_ec;
|
||||
|
||||
if (ec) {
|
||||
if (ec == transport::error::operation_aborted) {
|
||||
if (ec.value() == (int) transport::error::operation_aborted) {
|
||||
m_alog.write(log::alevel::devel,
|
||||
"asio post init timer cancelled");
|
||||
return;
|
||||
@ -572,7 +572,7 @@ protected:
|
||||
void handle_post_init(timer_ptr post_timer, init_handler callback,
|
||||
lib::error_code const & ec)
|
||||
{
|
||||
if (ec == transport::error::operation_aborted ||
|
||||
if (ec.value() == (int) transport::error::operation_aborted ||
|
||||
(post_timer && lib::asio::is_neg(post_timer->expires_from_now())))
|
||||
{
|
||||
m_alog.write(log::alevel::devel,"post_init cancelled");
|
||||
@ -650,7 +650,7 @@ protected:
|
||||
|
||||
void handle_proxy_timeout(init_handler callback, lib::error_code const & ec)
|
||||
{
|
||||
if (ec == transport::error::operation_aborted) {
|
||||
if (ec.value() == (int) transport::error::operation_aborted) {
|
||||
m_alog.write(log::alevel::devel,
|
||||
"asio handle_proxy_write timer cancelled");
|
||||
return;
|
||||
@ -678,7 +678,7 @@ protected:
|
||||
// Timer expired or the operation was aborted for some reason.
|
||||
// Whatever aborted it will be issuing the callback so we are safe to
|
||||
// return
|
||||
if (ec == lib::asio::error::operation_aborted ||
|
||||
if (ec.value() == (int) lib::asio::error::operation_aborted ||
|
||||
lib::asio::is_neg(m_proxy_data->timer->expires_from_now()))
|
||||
{
|
||||
m_elog.write(log::elevel::devel,"write operation aborted");
|
||||
@ -750,7 +750,7 @@ protected:
|
||||
// Timer expired or the operation was aborted for some reason.
|
||||
// Whatever aborted it will be issuing the callback so we are safe to
|
||||
// return
|
||||
if (ec == lib::asio::error::operation_aborted ||
|
||||
if (ec.value() == (int) lib::asio::error::operation_aborted ||
|
||||
lib::asio::is_neg(m_proxy_data->timer->expires_from_now()))
|
||||
{
|
||||
m_elog.write(log::elevel::devel,"read operation aborted");
|
||||
@ -875,7 +875,7 @@ protected:
|
||||
|
||||
// translate asio error codes into more lib::error_codes
|
||||
lib::error_code tec;
|
||||
if (ec == lib::asio::error::eof) {
|
||||
if (ec.value() == (int) lib::asio::error::eof) {
|
||||
tec = make_error_code(transport::error::eof);
|
||||
} else if (ec) {
|
||||
// We don't know much more about the error at this point. As our
|
||||
@ -883,8 +883,8 @@ protected:
|
||||
tec = socket_con_type::translate_ec(ec);
|
||||
m_tec = ec;
|
||||
|
||||
if (tec == transport::error::tls_error ||
|
||||
tec == transport::error::pass_through)
|
||||
if (tec.value() == (int) transport::error::tls_error ||
|
||||
tec.value() == (int) transport::error::pass_through)
|
||||
{
|
||||
// These are aggregate/catch all errors. Log some human readable
|
||||
// information to the info channel to give library users some
|
||||
@ -1073,7 +1073,7 @@ protected:
|
||||
lib::error_code ret_ec;
|
||||
|
||||
if (ec) {
|
||||
if (ec == transport::error::operation_aborted) {
|
||||
if (ec.value() == (int) transport::error::operation_aborted) {
|
||||
m_alog.write(log::alevel::devel,
|
||||
"asio socket shutdown timer cancelled");
|
||||
return;
|
||||
@ -1094,7 +1094,7 @@ protected:
|
||||
void handle_async_shutdown(timer_ptr shutdown_timer, shutdown_handler
|
||||
callback, lib::asio::error_code const & ec)
|
||||
{
|
||||
if (ec == lib::asio::error::operation_aborted ||
|
||||
if (ec.value() == (int) lib::asio::error::operation_aborted ||
|
||||
lib::asio::is_neg(shutdown_timer->expires_from_now()))
|
||||
{
|
||||
m_alog.write(log::alevel::devel,"async_shutdown cancelled");
|
||||
@ -1105,7 +1105,7 @@ protected:
|
||||
|
||||
lib::error_code tec;
|
||||
if (ec) {
|
||||
if (ec == lib::asio::error::not_connected) {
|
||||
if (ec.value() == (int) lib::asio::error::not_connected) {
|
||||
// The socket was already closed when we tried to close it. This
|
||||
// happens periodically (usually if a read or write fails
|
||||
// earlier and if it is a real error will be caught at another
|
||||
@ -1116,7 +1116,7 @@ protected:
|
||||
tec = socket_con_type::translate_ec(ec);
|
||||
m_tec = ec;
|
||||
|
||||
if (tec == transport::error::tls_short_read) {
|
||||
if (tec.value() == (int) transport::error::tls_short_read) {
|
||||
// TLS short read at this point is somewhat expected if both
|
||||
// sides try and end the connection at the same time or if
|
||||
// SSLv2 is being used. In general there is nothing that can
|
||||
@ -1141,7 +1141,7 @@ protected:
|
||||
void cancel_socket_checked() {
|
||||
lib::asio::error_code cec = socket_con_type::cancel_socket();
|
||||
if (cec) {
|
||||
if (cec == lib::asio::error::operation_not_supported) {
|
||||
if (cec.value() == (int) lib::asio::error::operation_not_supported) {
|
||||
// cancel not supported on this OS, ignore and log at dev level
|
||||
m_alog.write(log::alevel::devel, "socket cancel not supported");
|
||||
} else {
|
||||
|
@ -808,7 +808,7 @@ protected:
|
||||
m_alog->write(log::alevel::devel, "asio::handle_accept");
|
||||
|
||||
if (asio_ec) {
|
||||
if (asio_ec == lib::asio::errc::operation_canceled) {
|
||||
if (asio_ec.value() == (int) lib::asio::errc::operation_canceled) {
|
||||
ret_ec = make_error_code(websocketpp::error::operation_canceled);
|
||||
} else {
|
||||
log_err(log::elevel::info,"asio handle_accept",asio_ec);
|
||||
|
Loading…
x
Reference in New Issue
Block a user