From 77ff6dfafd234187f51e3ad854c41753b777522c Mon Sep 17 00:00:00 2001 From: Camden Narzt Date: Sun, 29 Dec 2024 12:32:04 -0700 Subject: [PATCH] fix use of updated websocketpp and boost --- src/agent/Core/AdminPanelConnector.h | 7 +++--- .../WebSocketCommandReverseServer.h | 23 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/agent/Core/AdminPanelConnector.h b/src/agent/Core/AdminPanelConnector.h index 6120935791..06dffbfc05 100644 --- a/src/agent/Core/AdminPanelConnector.h +++ b/src/agent/Core/AdminPanelConnector.h @@ -27,7 +27,6 @@ #define _PASSENGER_ADMIN_PANEL_CONNECTOR_H_ #include -#include #include #include @@ -197,14 +196,14 @@ class AdminPanelConnector { try { runInternalRubyTool(*resourceLocator, ruby, args, &status, &output); } catch (const std::exception &e) { - server.getIoService().post(boost::bind( + boost::asio::post(boost::bind( &AdminPanelConnector::onGetServerPropertiesDone, this, conn, doc, string(), -1, e.what() )); return; } - server.getIoService().post(boost::bind( + boost::asio::post(boost::bind( &AdminPanelConnector::onGetServerPropertiesDone, this, conn, doc, output.data, status, string() )); @@ -294,7 +293,7 @@ class AdminPanelConnector { void onGetGlobalConfigurationBgJob(const ConnectionPtr &conn, const Json::Value &input) { Json::Value globalConfig = configGetter()["config_manifest"]["effective_value"]["global_configuration"]; - server.getIoService().post(boost::bind( + boost::asio::post(boost::bind( &AdminPanelConnector::onGetGlobalConfigDone, this, conn, input, globalConfig )); diff --git a/src/cxx_supportlib/WebSocketCommandReverseServer.h b/src/cxx_supportlib/WebSocketCommandReverseServer.h index 955e160c68..3f9c7d2231 100644 --- a/src/cxx_supportlib/WebSocketCommandReverseServer.h +++ b/src/cxx_supportlib/WebSocketCommandReverseServer.h @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -256,8 +255,8 @@ class WebSocketCommandReverseServer { }; struct ConfigChangeRequest { - boost::scoped_ptr config; - boost::scoped_ptr configRlz; + boost::asio::detail::scoped_ptr config; + boost::asio::detail::scoped_ptr configRlz; }; typedef websocketpp::client Endpoint; @@ -286,7 +285,7 @@ class WebSocketCommandReverseServer { Endpoint endpoint; ConnectionPtr conn; - boost::shared_ptr timer; + boost::shared_ptr timer; MessageHandler messageHandler; Callback shutdownCallback; mutable boost::mutex stateSyncher; @@ -601,7 +600,7 @@ class WebSocketCommandReverseServer { } void restartTimer(unsigned int ms) { - timer->expires_from_now(boost::posix_time::milliseconds(ms)); + timer->expires_after(std::chrono::milliseconds(ms)); timer->async_wait(boost::bind( &WebSocketCommandReverseServer::onTimeout, this, @@ -806,7 +805,7 @@ class WebSocketCommandReverseServer { void initialize() { endpoint.init_asio(); state = NOT_CONNECTED; - timer = boost::make_shared( + timer = boost::make_shared( endpoint.get_io_service()); startConnect(); } @@ -833,7 +832,7 @@ class WebSocketCommandReverseServer { return config; } - boost::asio::io_service &getIoService() { + boost::asio::execution_context &getIoService() { return endpoint.get_io_service(); } @@ -863,7 +862,7 @@ class WebSocketCommandReverseServer { ConfigChangeRequest &req, const ConfigKit::CallbackTypes::PrepareConfigChange &callback) { - endpoint.get_io_service().post(boost::bind( + boost::asio::post(boost::bind( ConfigKit::callPrepareConfigChangeAndCallback, this, updates, &req, callback)); } @@ -872,19 +871,19 @@ class WebSocketCommandReverseServer { const ConfigKit::CallbackTypes::CommitConfigChange &callback) BOOST_NOEXCEPT_OR_NOTHROW { - endpoint.get_io_service().post(boost::bind( + boost::asio::post(boost::bind( ConfigKit::callCommitConfigChangeAndCallback, this, &req, callback)); } void asyncInspectConfig(const ConfigKit::CallbackTypes::InspectConfig &callback) { - endpoint.get_io_service().post(boost::bind( + boost::asio::post(boost::bind( ConfigKit::callInspectConfigAndCallback, this, callback)); } void asyncInspectState(const InspectCallback &callback) { - endpoint.get_io_service().post(boost::bind( + boost::asio::post(boost::bind( &WebSocketCommandReverseServer::internalInspectState, this, callback)); } @@ -899,7 +898,7 @@ class WebSocketCommandReverseServer { * This method is thread-safe and may be called from any thread. */ void asyncShutdown(const Callback &callback = Callback()) { - endpoint.get_io_service().post(boost::bind( + boost::asio::post(boost::bind( &WebSocketCommandReverseServer::internalShutdown, this, callback)); }