From: Francis Dupont Date: Sun, 10 May 2020 23:37:32 +0000 (+0200) Subject: [#1147] Checkpoint: began resources X-Git-Tag: Kea-1.7.9~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a41eacaa1241323b1e54f246ca1deb0d6d82caf2;p=thirdparty%2Fkea.git [#1147] Checkpoint: began resources --- diff --git a/src/bin/dhcp4/client_handler.h b/src/bin/dhcp4/client_handler.h index dd9ef9ea31..166dd5a281 100644 --- a/src/bin/dhcp4/client_handler.h +++ b/src/bin/dhcp4/client_handler.h @@ -50,12 +50,14 @@ public: /// @brief Tries to acquires a client. /// /// Lookup the client: - /// - if not found insert the client in the clients map and return true - /// - if found put the continuation in the holder and return false + /// - if not found insert the client in the clients map and return false + /// - if found and has a continuation put the continuation in the holder + /// and return false + /// - if found and has no continuation return true /// /// @param query The query from the client. /// @param cont The continuation in the case the client was held. - /// @return true if the client was acquired, false if there is already + /// @return false if the client was acquired, true if there is already /// a query from the same client. bool tryLock(Pkt4Ptr query, ContinuationPtr cont = ContinuationPtr()); diff --git a/src/bin/dhcp6/client_handler.h b/src/bin/dhcp6/client_handler.h index aae2d19c53..9e9b248fa4 100644 --- a/src/bin/dhcp6/client_handler.h +++ b/src/bin/dhcp6/client_handler.h @@ -48,12 +48,14 @@ public: /// @brief Tries to acquires a client. /// /// Lookup the client: - /// - if not found insert the client in the clients map and return true - /// - if found put the continuation in the holder and return false + /// - if not found insert the client in the clients map and return false + /// - if found and has a continuation put the continuation in the holder + /// and return false + /// - if found and has no continuation return true /// /// @param query The query from the client. /// @param cont The continuation in the case the client was held. - /// @return true if the client was acquired, false if there is already + /// @return false if the client was acquired, true if there is already /// a query from the same client. bool tryLock(Pkt6Ptr query, ContinuationPtr cont = ContinuationPtr()); diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am index 2a304b912b..6f055e35af 100644 --- a/src/lib/dhcpsrv/Makefile.am +++ b/src/lib/dhcpsrv/Makefile.am @@ -141,6 +141,7 @@ libkea_dhcpsrv_la_SOURCES += cql_lease_mgr.cc cql_lease_mgr.h endif libkea_dhcpsrv_la_SOURCES += pool.cc pool.h +libkea_dhcpsrv_la_SOURCES += resource_handler.cc resource_handler.h libkea_dhcpsrv_la_SOURCES += sanity_checker.cc sanity_checker.h libkea_dhcpsrv_la_SOURCES += shared_network.cc shared_network.h libkea_dhcpsrv_la_SOURCES += srv_config.cc srv_config.h @@ -357,6 +358,7 @@ libkea_dhcpsrv_include_HEADERS = \ network.h \ network_state.h \ pool.h \ + resource_handler.h \ sanity_checker.h \ shared_network.h \ srv_config.h \ diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/dhcpsrv/mysql_host_data_source.cc index e0e93a2daa..bfe97ec3b9 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/dhcpsrv/mysql_host_data_source.cc @@ -2589,7 +2589,7 @@ MySqlHostDataSource::MySqlHostContextAlloc::MySqlHostContextAlloc( } else { // single-threaded if (mgr_.pool_->pool_.empty()) { - isc_throw(Unexpected, "No available MySQL lease context?!"); + isc_throw(Unexpected, "No available MySQL host context?!"); } ctx_ = mgr_.pool_->pool_.back(); } diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.cc b/src/lib/dhcpsrv/pgsql_host_data_source.cc index 2bae72a1bb..cc874375e6 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.cc +++ b/src/lib/dhcpsrv/pgsql_host_data_source.cc @@ -2016,7 +2016,7 @@ PgSqlHostDataSource::PgSqlHostContextAlloc::PgSqlHostContextAlloc( } else { // single-threaded if (mgr_.pool_->pool_.empty()) { - isc_throw(Unexpected, "No available PostgreSQL lease context?!"); + isc_throw(Unexpected, "No available PostgreSQL host context?!"); } ctx_ = mgr_.pool_->pool_.back(); } diff --git a/src/lib/dhcpsrv/tests/Makefile.am b/src/lib/dhcpsrv/tests/Makefile.am index 74191ef0b7..b5ab1b84dd 100644 --- a/src/lib/dhcpsrv/tests/Makefile.am +++ b/src/lib/dhcpsrv/tests/Makefile.am @@ -119,6 +119,7 @@ libdhcpsrv_unittests_SOURCES += cql_lease_mgr_unittest.cc libdhcpsrv_unittests_SOURCES += cql_host_data_source_unittest.cc endif libdhcpsrv_unittests_SOURCES += pool_unittest.cc +libdhcpsrv_unittests_SOURCES += resource_handler_unittest.cc libdhcpsrv_unittests_SOURCES += sanity_checks_unittest.cc libdhcpsrv_unittests_SOURCES += shared_network_parser_unittest.cc libdhcpsrv_unittests_SOURCES += shared_network_unittest.cc