]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1147] Checkpoint: began resources
authorFrancis Dupont <fdupont@isc.org>
Sun, 10 May 2020 23:37:32 +0000 (01:37 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 26 May 2020 09:51:57 +0000 (11:51 +0200)
src/bin/dhcp4/client_handler.h
src/bin/dhcp6/client_handler.h
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/mysql_host_data_source.cc
src/lib/dhcpsrv/pgsql_host_data_source.cc
src/lib/dhcpsrv/tests/Makefile.am

index dd9ef9ea31fb94841fe654cd77cd1ade66c9ebaf..166dd5a2816b2cc1b1ea8860f0be59c47e2dab48 100644 (file)
@@ -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());
 
index aae2d19c53268aafcea5dbdbc246e3ab3c13a0b1..9e9b248fa435be3cf4226732420e0fe4c284c782 100644 (file)
@@ -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());
 
index 2a304b912b9dfc24ae2273ed28c6208e6508e17d..6f055e35afbd95a251ddbcf6005d1eefdde4a6fd 100644 (file)
@@ -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 \
index e0e93a2daa3fd75b5ab795b1a6ee33f8feb3f8dc..bfe97ec3b9a7b8c12fa96f81e515d88984dc64ad 100644 (file)
@@ -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();
     }
index 2bae72a1bb99e33ff494695f74fad8f3dae8af94..cc874375e6bcf7ceff4f31e0e1e1a89f5056cad0 100644 (file)
@@ -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();
     }
index 74191ef0b7faa7ab1503a0713c6cc2085db5a55e..b5ab1b84ddc7c76604c7b2807c037da41e5062f1 100644 (file)
@@ -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