]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3696] Made >= 1.66 mandatory
authorFrancis Dupont <fdupont@isc.org>
Fri, 20 Dec 2024 13:40:47 +0000 (14:40 +0100)
committerFrancis Dupont <fdupont@isc.org>
Wed, 15 Jan 2025 14:26:32 +0000 (15:26 +0100)
m4macros/ax_boost_for_kea.m4
src/lib/asiolink/io_acceptor.h
src/lib/asiolink/io_address.cc
src/lib/asiolink/io_service.cc
src/lib/asiolink/io_service.h
src/lib/asiolink/tcp_socket.h
src/lib/asiolink/tls_socket.h
src/lib/asiolink/udp_socket.h
src/lib/asiolink/unix_domain_socket.cc

index c2714eef272e18ed88ef4a23db2662afaee11d1a..996413374a6ec9ad070b7ac44315a97517a1a88f 100644 (file)
@@ -101,6 +101,8 @@ AC_CHECK_HEADERS(boost/asio/coroutine.hpp,,AC_MSG_RESULT(not found, using built-
 
 AC_CHECK_HEADERS(boost/integer/common_factor.hpp)
 
+AC_CHECK_HEADERS(boost/asio/io_context.hpp,,AC_MSG_ERROR([Missing boost asio io_context header: boost version must be at least 1.66]))
+
 # Verify that the path does not include standard headers by mistake.
 # There are two regex.h headers: one is a standard system header (usually
 # in /usr/include) and the second one is provided by boost. If you specify the
index 0909048880cdc06f5676de00d542bada4f2183ea..4491f7c3aaca8d28aea740b4b971af707ba2ac9a 100644 (file)
@@ -47,11 +47,7 @@ public:
 
     /// @brief Returns file descriptor of the underlying socket.
     virtual int getNative() const {
-#if BOOST_VERSION < 106600
-        return (acceptor_->native());
-#else
         return (acceptor_->native_handle());
-#endif
     }
 
     /// @brief Opens acceptor socket given the endpoint.
index 06b7d3d990c493a78d5253eed4e56d882e90b2e4..a5af53151361b38931b4c07c0afb8850087b35d5 100644 (file)
 #include <sys/socket.h>
 #include <netinet/in.h>
 
+#if BOOST_VERSION < 106600
+#error "Boost ASIO older than 1.66 are not supported"
+#endif
+
 using namespace boost::asio;
 using boost::asio::ip::udp;
 using boost::asio::ip::tcp;
index cc28d24c19fe7c850a13e7743b69b01f6f981e2e..91af69ade31ae2354cc3acc0a513b328ac78775b 100644 (file)
@@ -101,13 +101,13 @@ public:
         work_.reset();
     }
 
-    /// @brief Return the native @c io_service object used in this wrapper.
+    /// @brief Return the native @c io_context object used in this wrapper.
     ///
     /// This is a short term work around to support other Kea modules
-    /// that share the same @c io_service with the authoritative server.
+    /// that share the same @c io_context with the authoritative server.
     /// It will eventually be removed once the wrapper interface is
     /// generalized.
-    boost::asio::io_service& getInternalIOService() {
+    boost::asio::io_context& getInternalIOService() {
         return (io_service_);
     }
 
@@ -119,8 +119,8 @@ public:
     }
 
 private:
-    boost::asio::io_service io_service_;
-    boost::asio::executor_work_guard<boost::asio::io_service::executor_type> work_;
+    boost::asio::io_context io_service_;
+    boost::asio::executor_work_guard<boost::asio::io_context::executor_type> work_;
 };
 
 IOService::IOService() : io_impl_(new IOServiceImpl()) {
@@ -169,7 +169,7 @@ IOService::stopWork() {
     io_impl_->stopWork();
 }
 
-boost::asio::io_service&
+boost::asio::io_context&
 IOService::getInternalIOService() {
     return (io_impl_->getInternalIOService());
 }
index 66dff619b9faf702abb4f9e172d4734fc55d805c..c1aa04b4bf614727e45876a5ea7aa7a35f2b08f1 100644 (file)
 #include <functional>
 #include <list>
 
-namespace boost {
-namespace asio {
 #if BOOST_VERSION < 106600
-    class io_service;
-#else
-    class io_context;
-    typedef io_context io_service;
+#error "Boost ASIO older than 1.66 are not supported"
 #endif
+
+// Include boost/asio/io_context.hpp instead?
+namespace boost {
+namespace asio {
+class io_context;
 }
 }
 
@@ -32,7 +32,7 @@ class IOService;
 /// @brief Defines a smart pointer to an IOService instance.
 typedef boost::shared_ptr<IOService> IOServicePtr;
 
-/// @brief The @ref IOService class is a wrapper for the ASIO @c io_service
+/// @brief The @ref IOService class is a wrapper for the ASIO @c io_context
 /// class.
 class IOService {
     /// @brief Constructors and Destructor.
@@ -99,15 +99,15 @@ public:
     /// when all handlers have been invoked.
     void stopWork();
 
-    /// @brief Return the native @c io_service object used in this wrapper.
+    /// @brief Return the native @c io_context object used in this wrapper.
     ///
     /// This is a short term work around to support other Kea modules
-    /// that share the same @c io_service with the authoritative server.
+    /// that share the same @c io_context with the authoritative server.
     /// It will eventually be removed once the wrapper interface is
     /// generalized.
     ///
-    /// @return The internal io_service object.
-    boost::asio::io_service& getInternalIOService();
+    /// @return The internal io_context object.
+    boost::asio::io_context& getInternalIOService();
 
     /// @brief Post a callback to the end of the queue.
     ///
index e56abe412d7ab4d367180c078ccec552db602f01..830f1a2a28f1690c30a2db44350f507d7f6ecfe9 100644 (file)
@@ -73,11 +73,7 @@ public:
 
     /// \brief Return file descriptor of underlying socket
     virtual int getNative() const {
-#if BOOST_VERSION < 106600
-        return (socket_.native());
-#else
         return (socket_.native_handle());
-#endif
     }
 
     /// \brief Return protocol of socket
index 80006dc10cce5448b6a5ccdb37f4a6b059ca2ad9..96382cc77f4592e2dde93d919a104f7fa50cc8b3 100644 (file)
@@ -50,11 +50,7 @@ public:
 
     /// @brief Return file descriptor of underlying socket.
     virtual int getNative() const {
-#if BOOST_VERSION < 106600
-        return (socket_.native());
-#else
         return (socket_.native_handle());
-#endif
     }
 
     /// @brief Return protocol of socket.
index 380d344e36a713726aeb52393f9440ed8652df1e..db6c3a8eb4e778ef1255517bc878bc63b4478092 100644 (file)
@@ -63,11 +63,7 @@ public:
 
     /// \brief Return file descriptor of underlying socket
     virtual int getNative() const {
-#if BOOST_VERSION < 106600
-        return (socket_.native());
-#else
         return (socket_.native_handle());
-#endif
     }
 
     /// \brief Return protocol of socket
index 43ff3c8f241484f5e5db517d5b7e497091b64c7a..88d3dcdc5520b6af08a8b3ce9a806ce87514d862 100644 (file)
@@ -289,11 +289,7 @@ UnixDomainSocket::UnixDomainSocket(const IOServicePtr& io_service)
 
 int
 UnixDomainSocket::getNative() const {
-#if BOOST_VERSION < 106600
-    return (impl_->socket_.native());
-#else
     return (impl_->socket_.native_handle());
-#endif
 }
 
 int