diff options
author | Ed Tanous <ed.tanous@intel.com> | 2018-12-20 01:51:54 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-01-12 04:38:02 +0300 |
commit | 8f626357d5ebee1bf8039ad6e85f5e02c64c9076 (patch) | |
tree | 95ebd433a4d479ab8b7012ba4b741201b6a2a307 /src | |
parent | c0eb9bd95afa900dc808dce7c2c5fa521ba828f5 (diff) | |
download | bmcweb-8f626357d5ebee1bf8039ad6e85f5e02c64c9076.tar.xz |
bmcweb: Remove deprecatd ASIO interfaces
boost::asio::io_service is removed in leiu of io_context, which is a
closer match to the networking TS. Move us to that implementatio.
This was an automated move using the following command:
git grep -l 'io_service' | xargs sed -i 's/io_service/io_context/g'
Change-Id: I46605521c01f79f86f6901ddf69ddc8c4bc24103
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/crow_test.cpp | 10 | ||||
-rw-r--r-- | src/kvm_websocket_test.cpp | 2 | ||||
-rw-r--r-- | src/security_headers_middleware_test.cpp | 2 | ||||
-rw-r--r-- | src/token_authorization_middleware_test.cpp | 14 | ||||
-rw-r--r-- | src/webassets_test.cpp | 4 | ||||
-rw-r--r-- | src/webserver_main.cpp | 4 |
6 files changed, 18 insertions, 18 deletions
diff --git a/src/crow_test.cpp b/src/crow_test.cpp index 96b90b0ed2..beefdeee2a 100644 --- a/src/crow_test.cpp +++ b/src/crow_test.cpp @@ -398,7 +398,7 @@ TEST(Crow, server_handling_error_request) Server<SimpleApp> server(&app, LOCALHOST_ADDRESS, 45451); auto _ = async(launch::async, [&] { server.run(); }); std::string sendmsg = "POX"; - asio::io_service is; + asio::io_context is; { asio::ip::tcp::socket c(is); c.connect(asio::ip::tcp::endpoint( @@ -436,7 +436,7 @@ TEST(Crow, multi_server) std::string sendmsg = "POST /\r\nContent-Length:3\r\nX-HeaderTest: 123\r\n\r\nA=b\r\n"; - asio::io_service is; + asio::io_context is; { asio::ip::tcp::socket c(is); c.connect(asio::ip::tcp::endpoint( @@ -645,7 +645,7 @@ TEST(Crow, middlewareContext) decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451); auto _ = async(launch::async, [&] { server.run(); }); std::string sendmsg = "GET /\r\n\r\n"; - asio::io_service is; + asio::io_context is; { asio::ip::tcp::socket c(is); c.connect(asio::ip::tcp::endpoint( @@ -701,7 +701,7 @@ TEST(Crow, bug_quick_repeated_request) decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451); auto _ = async(launch::async, [&] { server.run(); }); std::string sendmsg = "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n"; - asio::io_service is; + asio::io_context is; { std::vector<std::future<void>> v; for (int i = 0; i < 5; i++) @@ -744,7 +744,7 @@ TEST(Crow, simple_url_params) decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451); auto _ = async(launch::async, [&] { server.run(); }); - asio::io_service is; + asio::io_context is; std::string sendmsg; // check empty params diff --git a/src/kvm_websocket_test.cpp b/src/kvm_websocket_test.cpp index 1ddaad9b35..40470a9212 100644 --- a/src/kvm_websocket_test.cpp +++ b/src/kvm_websocket_test.cpp @@ -24,7 +24,7 @@ TEST(Kvm, BasicRfb) BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; }); auto _ = async(std::launch::async, [&] { app.run(); }); auto routes = app.getRoutes(); - asio::io_service is; + asio::io_context is; { // Retry a couple of times waiting for the server to come up diff --git a/src/security_headers_middleware_test.cpp b/src/security_headers_middleware_test.cpp index 2af15c6d07..4fa3003e71 100644 --- a/src/security_headers_middleware_test.cpp +++ b/src/security_headers_middleware_test.cpp @@ -16,7 +16,7 @@ TEST(SecurityHeaders, TestHeadersExist) BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; }); auto _ = async(launch::async, [&] { app.run(); }); - asio::io_service is; + asio::io_context is; std::array<char, 2048> buf; std::string sendmsg; diff --git a/src/token_authorization_middleware_test.cpp b/src/token_authorization_middleware_test.cpp index 812a6d193e..8f4c5c8252 100644 --- a/src/token_authorization_middleware_test.cpp +++ b/src/token_authorization_middleware_test.cpp @@ -15,14 +15,14 @@ class TokenAuth : public ::testing::Test public: TokenAuth() : lk(std::unique_lock<std::mutex>(m)), - io(std::make_shared<boost::asio::io_service>()) + io(std::make_shared<boost::asio::io_context>()) { } std::mutex m; std::condition_variable cv; std::unique_lock<std::mutex> lk; - std::shared_ptr<boost::asio::io_service> io; + std::shared_ptr<boost::asio::io_context> io; int testPort = 45451; }; @@ -38,7 +38,7 @@ TEST_F(TokenAuth, SpecialResourcesAreAcceptedWithoutAuth) io->run(); }); - asio::io_service is; + asio::io_context is; std::string sendmsg; static char buf[2048]; @@ -80,7 +80,7 @@ TEST(TokenAuthentication, TestRejectedResource) BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; }); auto _ = async(std::launch::async, [&] { app.run(); }); - asio::io_service is; + asio::io_context is; static char buf[2048]; // Other resources should not be passed @@ -116,7 +116,7 @@ TEST(TokenAuthentication, TestGetLoginUrl) BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; }); auto _ = async(std::launch::async, [&] { app.run(); }); - asio::io_service is; + asio::io_context is; static char buf[2048]; // Other resources should not be passed @@ -152,7 +152,7 @@ TEST(TokenAuthentication, TestPostBadLoginUrl) BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; }); auto _ = async(std::launch::async, [&] { app.run(); }); - asio::io_service is; + asio::io_context is; std::array<char, 2048> buf; std::string sendmsg; @@ -244,7 +244,7 @@ TEST(TokenAuthentication, TestSuccessfulLogin) BMCWEB_ROUTE(app, "/")([]() { return boost::beast::http::status::ok; }); auto _ = async(std::launch::async, [&] { app.run(); }); - asio::io_service is; + asio::io_context is; std::array<char, 2048> buf; std::string sendmsg; diff --git a/src/webassets_test.cpp b/src/webassets_test.cpp index a3106f2796..3df754220b 100644 --- a/src/webassets_test.cpp +++ b/src/webassets_test.cpp @@ -25,7 +25,7 @@ TEST(Webassets, StaticFilesFixedRoutes) // get the homepage std::string sendmsg = "GET /\r\n\r\n"; - asio::io_service is; + asio::io_context is; asio::ip::tcp::socket c(is); c.connect(asio::ip::tcp::endpoint( @@ -100,7 +100,7 @@ TEST(Webassets, EtagIsSane) // get the homepage std::string sendmsg = "GET /\r\n\r\n"; - asio::io_service is; + asio::io_context is; asio::ip::tcp::socket c(is); c.connect(asio::ip::tcp::endpoint( diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp index b4d36efb4e..7c64f4c748 100644 --- a/src/webserver_main.cpp +++ b/src/webserver_main.cpp @@ -1,7 +1,7 @@ #include <crow/app.h> #include <systemd/sd-daemon.h> -#include <boost/asio/io_service.hpp> +#include <boost/asio/io_context.hpp> #include <dbus_monitor.hpp> #include <dbus_singleton.hpp> #include <image_upload.hpp> @@ -57,7 +57,7 @@ int main(int argc, char** argv) { crow::logger::setLogLevel(crow::LogLevel::DEBUG); - auto io = std::make_shared<boost::asio::io_service>(); + auto io = std::make_shared<boost::asio::io_context>(); CrowApp app(io); #ifdef BMCWEB_ENABLE_SSL |