diff options
-rw-r--r-- | src/bin/d2/d2_process.cc | 11 | ||||
-rw-r--r-- | src/lib/asiodns/tests/io_fetch_unittest.cc | 2 | ||||
-rw-r--r-- | src/lib/asiolink/tests/tcp_acceptor_unittest.cc | 4 | ||||
-rw-r--r-- | src/lib/asiolink/tests/tls_acceptor_unittest.cc | 6 | ||||
-rw-r--r-- | src/lib/asiolink/tests/tls_unittest.cc | 40 | ||||
-rw-r--r-- | src/lib/asiolink/testutils/botan_sample_client.cc | 6 | ||||
-rw-r--r-- | src/lib/asiolink/testutils/botan_sample_server.cc | 4 | ||||
-rw-r--r-- | src/lib/asiolink/testutils/openssl_sample_client.cc | 6 | ||||
-rw-r--r-- | src/lib/asiolink/testutils/openssl_sample_server.cc | 8 | ||||
-rw-r--r-- | src/lib/config/tests/cmd_http_listener_unittests.cc | 2 | ||||
-rw-r--r-- | src/lib/d2srv/tests/dns_client_unittests.cc | 6 | ||||
-rw-r--r-- | src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc | 2 | ||||
-rw-r--r-- | src/lib/http/tests/http_server_unittests.cc | 3 | ||||
-rw-r--r-- | src/lib/http/tests/tls_server_unittests.cc | 3 | ||||
-rw-r--r-- | src/lib/http/testutils/test_http_client.h | 5 | ||||
-rw-r--r-- | src/lib/tcp/tests/mt_tcp_listener_mgr_unittests.cc | 2 | ||||
-rw-r--r-- | src/lib/tcp/tests/tcp_test_client.h | 2 |
17 files changed, 48 insertions, 64 deletions
diff --git a/src/bin/d2/d2_process.cc b/src/bin/d2/d2_process.cc index dc1ed1b9a3..9ea00daa6b 100644 --- a/src/bin/d2/d2_process.cc +++ b/src/bin/d2/d2_process.cc @@ -144,16 +144,7 @@ size_t D2Process::runIO() { // Handle events registered by hooks using external IOService objects. IOServiceMgr::instance().pollIOServices(); - // We want to block until at least one handler is called. We'll use - // boost::asio::io_service directly for two reasons. First off - // asiolink::IOService::runOne is a void and boost::asio::io_service::stopped - // is not present in older versions of boost. We need to know if any - // handlers ran or if the io_service was stopped. That latter represents - // some form of error and the application cannot proceed with a stopped - // service. Secondly, asiolink::IOService does not provide the poll - // method. This is a handy method which runs all ready handlers without - // blocking. - + // We want to block until at least one handler is called. // Poll runs all that are ready. If none are ready it returns immediately // with a count of zero. size_t cnt = getIOService()->poll(); diff --git a/src/lib/asiodns/tests/io_fetch_unittest.cc b/src/lib/asiodns/tests/io_fetch_unittest.cc index 7db3dc66bc..a412fec94a 100644 --- a/src/lib/asiodns/tests/io_fetch_unittest.cc +++ b/src/lib/asiodns/tests/io_fetch_unittest.cc @@ -44,7 +44,7 @@ namespace ph = std::placeholders; namespace isc { namespace asiodns { -const boost::asio::ip::address TEST_HOST(boost::asio::ip::address::from_string("127.0.0.1")); +const boost::asio::ip::address TEST_HOST(boost::asio::ip::make_address("127.0.0.1")); const uint16_t TEST_PORT(5301); const int SEND_INTERVAL = 250; // Interval in ms between TCP sends const size_t MAX_SIZE = 64 * 1024; // Should be able to take 64kB diff --git a/src/lib/asiolink/tests/tcp_acceptor_unittest.cc b/src/lib/asiolink/tests/tcp_acceptor_unittest.cc index a9d93876f6..31a53f6505 100644 --- a/src/lib/asiolink/tests/tcp_acceptor_unittest.cc +++ b/src/lib/asiolink/tests/tcp_acceptor_unittest.cc @@ -82,7 +82,7 @@ public: /// connectHandler as a callback function. void connect() { boost::asio::ip::tcp::endpoint - endpoint(boost::asio::ip::address::from_string(SERVER_ADDRESS), + endpoint(boost::asio::ip::make_address(SERVER_ADDRESS), SERVER_PORT); socket_.async_connect(endpoint, std::bind(&TCPClient::connectHandler, this, @@ -208,7 +208,7 @@ public: /// unsuccessful. TCPAcceptorTest() : io_service_(new IOService()), acceptor_(io_service_), - asio_endpoint_(boost::asio::ip::address::from_string(SERVER_ADDRESS), + asio_endpoint_(boost::asio::ip::make_address(SERVER_ADDRESS), SERVER_PORT), endpoint_(asio_endpoint_), test_timer_(io_service_), connections_(), clients_(), connections_num_(0), aborted_connections_num_(0), diff --git a/src/lib/asiolink/tests/tls_acceptor_unittest.cc b/src/lib/asiolink/tests/tls_acceptor_unittest.cc index 78889cd4ef..a20fdebc7c 100644 --- a/src/lib/asiolink/tests/tls_acceptor_unittest.cc +++ b/src/lib/asiolink/tests/tls_acceptor_unittest.cc @@ -83,8 +83,7 @@ public: /// connectHandler as a callback function. void connect() { ip::tcp::endpoint - endpoint(ip::address::from_string(SERVER_ADDRESS), - SERVER_PORT); + endpoint(ip::make_address(SERVER_ADDRESS), SERVER_PORT); socket_.async_connect(endpoint, std::bind(&TLSClient::connectHandler, this, ph::_1)); @@ -215,8 +214,7 @@ public: /// unsuccessful. TLSAcceptorTest() : io_service_(new IOService()), acceptor_(io_service_), - asio_endpoint_(ip::address::from_string(SERVER_ADDRESS), - SERVER_PORT), + asio_endpoint_(ip::make_address(SERVER_ADDRESS), SERVER_PORT), endpoint_(asio_endpoint_), test_timer_(io_service_), connections_(), clients_(), connections_num_(0), aborted_connections_num_(0), max_connections_(1), running_(true) { diff --git a/src/lib/asiolink/tests/tls_unittest.cc b/src/lib/asiolink/tests/tls_unittest.cc index cfebf1345c..efcf359cb8 100644 --- a/src/lib/asiolink/tests/tls_unittest.cc +++ b/src/lib/asiolink/tests/tls_unittest.cc @@ -772,7 +772,7 @@ TEST_F(TLSTest, noHandshake) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -877,7 +877,7 @@ TEST_F(TLSTest, serverNotConfigured) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -975,7 +975,7 @@ TEST_F(TLSTest, clientNotConfigured) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1072,7 +1072,7 @@ TEST_F(TLSTest, clientHTTPnoS) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1165,7 +1165,7 @@ TEST_F(TLSTest, unknownClient) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1254,7 +1254,7 @@ TEST_F(TLSTest, anotherClient) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1353,7 +1353,7 @@ TEST_F(TLSTest, selfSigned) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1460,7 +1460,7 @@ TEST_F(TLSTest, noHandshakeCloseonError) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1561,7 +1561,7 @@ TEST_F(TLSTest, serverNotConfiguredCloseonError) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1658,7 +1658,7 @@ TEST_F(TLSTest, clientNotConfiguredCloseonError) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1754,7 +1754,7 @@ TEST_F(TLSTest, clientHTTPnoSCloseonError) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1847,7 +1847,7 @@ TEST_F(TLSTest, anotherClientCloseonError) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -1944,7 +1944,7 @@ TEST_F(TLSTest, selfSignedCloseonError) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2048,7 +2048,7 @@ TEST_F(TLSTest, anotherClientNoReq) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2118,7 +2118,7 @@ TEST_F(TLSTest, serverRaw) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2189,7 +2189,7 @@ TEST_F(TLSTest, trustedSelfSigned) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2265,7 +2265,7 @@ TEST_F(TLSTest, shutdownInactive) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2360,7 +2360,7 @@ TEST_F(TLSTest, shutdownActive) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2469,7 +2469,7 @@ TEST_F(TLSTest, shutdownCloseInactive) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); @@ -2570,7 +2570,7 @@ TEST_F(TLSTest, shutdownCloseActive) { server_.reset(new TlsStream<TestCallback>(io_service_, server_ctx)); // Accept a client. - tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS), + tcp::endpoint server_ep(tcp::endpoint(make_address(SERVER_ADDRESS), SERVER_PORT)); tcp::acceptor acceptor(io_service_->getInternalIOService(), server_ep); acceptor.set_option(tcp::acceptor::reuse_address(true)); diff --git a/src/lib/asiolink/testutils/botan_sample_client.cc b/src/lib/asiolink/testutils/botan_sample_client.cc index 9e322fb543..5930186cb7 100644 --- a/src/lib/asiolink/testutils/botan_sample_client.cc +++ b/src/lib/asiolink/testutils/botan_sample_client.cc @@ -101,7 +101,7 @@ public: class client { public: - client(boost::asio::io_service& io_context, + client(boost::asio::io_context& io_context, Botan::TLS::Context& context, const tcp::endpoint& endpoint) : socket_(io_context, context) @@ -205,11 +205,11 @@ int main(int argc, char* argv[]) return 1; } - boost::asio::io_service io_context; + boost::asio::io_context io_context; using namespace std; // For atoi. tcp::endpoint endpoint( - boost::asio::ip::address::from_string(argv[1]), atoi(argv[2])); + boost::asio::ip::make_address(argv[1]), atoi(argv[2])); Botan::AutoSeeded_RNG rng; Client_Credentials_Manager creds_mgr(rng); Client_Session_Manager sess_mgr; diff --git a/src/lib/asiolink/testutils/botan_sample_server.cc b/src/lib/asiolink/testutils/botan_sample_server.cc index 2d6be475ce..c9c2843a7b 100644 --- a/src/lib/asiolink/testutils/botan_sample_server.cc +++ b/src/lib/asiolink/testutils/botan_sample_server.cc @@ -160,7 +160,7 @@ private: class server { public: - server(boost::asio::io_service& io_context, + server(boost::asio::io_contex& io_context, unsigned short port, Botan::Credentials_Manager& creds_mgr, Botan::RandomNumberGenerator& rng, @@ -201,7 +201,7 @@ int main(int argc, char* argv[]) return 1; } - boost::asio::io_service io_context; + boost::asio::io_context io_context; Botan::AutoSeeded_RNG rng; Server_Credentials_Manager creds_mgr(rng); diff --git a/src/lib/asiolink/testutils/openssl_sample_client.cc b/src/lib/asiolink/testutils/openssl_sample_client.cc index d71de4e7f4..1b8ee01f55 100644 --- a/src/lib/asiolink/testutils/openssl_sample_client.cc +++ b/src/lib/asiolink/testutils/openssl_sample_client.cc @@ -34,7 +34,7 @@ enum { max_length = 1024 }; class client { public: - client(boost::asio::io_service& io_context, + client(boost::asio::io_context& io_context, boost::asio::ssl::context& context, const tcp::endpoint& endpoint) : socket_(io_context, context) @@ -154,11 +154,11 @@ int main(int argc, char* argv[]) return 1; } - boost::asio::io_service io_context; + boost::asio::io_context io_context; using namespace std; // For atoi. tcp::endpoint endpoint( - boost::asio::ip::address::from_string(argv[1]), atoi(argv[2])); + boost::asio::ip::make_address(argv[1]), atoi(argv[2])); boost::asio::ssl::context ctx(boost::asio::ssl::context::method::tls); ctx.load_verify_file(CA_("kea-ca.crt")); diff --git a/src/lib/asiolink/testutils/openssl_sample_server.cc b/src/lib/asiolink/testutils/openssl_sample_server.cc index b92e253b05..11c7d8c801 100644 --- a/src/lib/asiolink/testutils/openssl_sample_server.cc +++ b/src/lib/asiolink/testutils/openssl_sample_server.cc @@ -32,7 +32,7 @@ typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> ssl_socket; class session { public: - session(boost::asio::io_service& io_context, + session(boost::asio::io_context& io_context, boost::asio::ssl::context& context) : socket_(io_context, context) { @@ -106,7 +106,7 @@ private: class server { public: - server(boost::asio::io_service& io_context, unsigned short port) + server(boost::asio::io_context& io_context, unsigned short port) : io_context_(io_context), acceptor_(io_context, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port)), @@ -152,7 +152,7 @@ public: } private: - boost::asio::io_service& io_context_; + boost::asio::io_context& io_context_; boost::asio::ip::tcp::acceptor acceptor_; boost::asio::ssl::context context_; }; @@ -167,7 +167,7 @@ int main(int argc, char* argv[]) return 1; } - boost::asio::io_service io_context; + boost::asio::io_context io_context; using namespace std; // For atoi. server s(io_context, atoi(argv[1])); diff --git a/src/lib/config/tests/cmd_http_listener_unittests.cc b/src/lib/config/tests/cmd_http_listener_unittests.cc index ee7c7499fa..9998739434 100644 --- a/src/lib/config/tests/cmd_http_listener_unittests.cc +++ b/src/lib/config/tests/cmd_http_listener_unittests.cc @@ -179,7 +179,7 @@ public: /// @brief Runs IO service with optional timeout. /// - /// We iterate over calls to asio::io_service.run(), until + /// We iterate over calls to asio::io_context.run(), until /// all the clients have completed their requests. We do it this way /// because the test clients stop the io_service when they're /// through with a request. diff --git a/src/lib/d2srv/tests/dns_client_unittests.cc b/src/lib/d2srv/tests/dns_client_unittests.cc index ff96dba449..da18bccd92 100644 --- a/src/lib/d2srv/tests/dns_client_unittests.cc +++ b/src/lib/d2srv/tests/dns_client_unittests.cc @@ -397,8 +397,7 @@ public: socket_.reset(new udp::socket(service_->getInternalIOService(), boost::asio::ip::udp::v4())); socket_->set_option(socket_base::reuse_address(true)); - socket_->bind(udp::endpoint(address::from_string(TEST_ADDRESS), - TEST_PORT)); + socket_->bind(udp::endpoint(make_address(TEST_ADDRESS), TEST_PORT)); // Once socket is created, we can post an IO request to receive some // packet from this socket. This is asynchronous operation and // nothing is received until another IO request to send a query is @@ -469,8 +468,7 @@ public: // Setup our "loopback" server. udp::socket udp_socket(service_->getInternalIOService(), boost::asio::ip::udp::v4()); udp_socket.set_option(socket_base::reuse_address(true)); - udp_socket.bind(udp::endpoint(address::from_string(TEST_ADDRESS), - TEST_PORT)); + udp_socket.bind(udp::endpoint(make_address(TEST_ADDRESS), TEST_PORT)); udp::endpoint remote; udp_socket.async_receive_from(boost::asio::buffer(receive_buffer_, sizeof(receive_buffer_)), diff --git a/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc b/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc index 46023911f3..792aa28ace 100644 --- a/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc +++ b/src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc @@ -222,7 +222,7 @@ public: // Create an endpoint pointed at the listener. boost::asio::ip::udp::endpoint - listener_endpoint(boost::asio::ip::address::from_string(TEST_ADDRESS), + listener_endpoint(boost::asio::ip::make_address(TEST_ADDRESS), LISTENER_PORT); // A response message is now ready to send. Send it! diff --git a/src/lib/http/tests/http_server_unittests.cc b/src/lib/http/tests/http_server_unittests.cc index a05e5fbc8f..757db2a69d 100644 --- a/src/lib/http/tests/http_server_unittests.cc +++ b/src/lib/http/tests/http_server_unittests.cc @@ -147,8 +147,7 @@ TEST_F(HttpListenerTest, addressInUse) { tcp::acceptor acceptor(io_service_->getInternalIOService()); // Use other port than SERVER_PORT to make sure that this TCP connection // doesn't affect subsequent tests. - tcp::endpoint endpoint(address::from_string(SERVER_ADDRESS), - SERVER_PORT + 1); + tcp::endpoint endpoint(make_address(SERVER_ADDRESS), SERVER_PORT + 1); acceptor.open(endpoint.protocol()); acceptor.bind(endpoint); diff --git a/src/lib/http/tests/tls_server_unittests.cc b/src/lib/http/tests/tls_server_unittests.cc index e8cabfb248..417d2c3712 100644 --- a/src/lib/http/tests/tls_server_unittests.cc +++ b/src/lib/http/tests/tls_server_unittests.cc @@ -161,8 +161,7 @@ TEST_F(HttpsListenerTest, addressInUse) { tcp::acceptor acceptor(io_service_->getInternalIOService()); // Use other port than SERVER_PORT to make sure that this TCP connection // doesn't affect subsequent tests. - tcp::endpoint endpoint(address::from_string(SERVER_ADDRESS), - SERVER_PORT + 1); + tcp::endpoint endpoint(make_address(SERVER_ADDRESS), SERVER_PORT + 1); acceptor.open(endpoint.protocol()); acceptor.bind(endpoint); diff --git a/src/lib/http/testutils/test_http_client.h b/src/lib/http/testutils/test_http_client.h index c1d9deace9..3518bf2569 100644 --- a/src/lib/http/testutils/test_http_client.h +++ b/src/lib/http/testutils/test_http_client.h @@ -117,7 +117,7 @@ public: /// /// @param request HTTP request in the textual format. virtual void startRequest(const std::string& request) { - tcp::endpoint endpoint(address::from_string(server_address_), server_port_); + tcp::endpoint endpoint(make_address(server_address_), server_port_); auto ref = shared_from_this(); socket_.async_connect(endpoint, [this, ref, request](const boost::system::error_code& ec) { @@ -392,8 +392,7 @@ public: /// /// @param request HTTP request in the textual format. virtual void startRequest(const std::string& request) { - tcp::endpoint endpoint(address::from_string(server_address_), - server_port_); + tcp::endpoint endpoint(make_address(server_address_), server_port_); auto ref = shared_from_this(); stream_.lowest_layer().async_connect(endpoint, [this, ref, request](const boost::system::error_code& ec) { diff --git a/src/lib/tcp/tests/mt_tcp_listener_mgr_unittests.cc b/src/lib/tcp/tests/mt_tcp_listener_mgr_unittests.cc index ad8ecea4c9..d5aeda0d55 100644 --- a/src/lib/tcp/tests/mt_tcp_listener_mgr_unittests.cc +++ b/src/lib/tcp/tests/mt_tcp_listener_mgr_unittests.cc @@ -214,7 +214,7 @@ public: /// @brief Runs IO service with optional timeout. /// - /// We iterate over calls to asio::io_service.run(), until + /// We iterate over calls to asio::io_context.run(), until /// all the clients have completed their requests. We do it this way /// because the test clients stop the io_service when they're /// through with a request. diff --git a/src/lib/tcp/tests/tcp_test_client.h b/src/lib/tcp/tests/tcp_test_client.h index b453eded08..e6658be80c 100644 --- a/src/lib/tcp/tests/tcp_test_client.h +++ b/src/lib/tcp/tests/tcp_test_client.h @@ -114,7 +114,7 @@ public: /// Upon successful connection, carry out the TLS handshake. If the handshake /// completes successful start sending requests. void start() { - isc::asiolink::TCPEndpoint endpoint(boost::asio::ip::address::from_string(server_address_), server_port_); + isc::asiolink::TCPEndpoint endpoint(boost::asio::ip::make_address(server_address_), server_port_); SocketCallback socket_cb( [this](boost::system::error_code ec, size_t /*length */) { receive_done_ = false; |