]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[894-make-memfile-thread-safe] Finished update
authorFrancis Dupont <fdupont@isc.org>
Mon, 4 Nov 2019 19:41:24 +0000 (20:41 +0100)
committerRazvan Becheriu <razvan@isc.org>
Thu, 23 Jan 2020 13:26:40 +0000 (15:26 +0200)
src/lib/dhcpsrv/memfile_lease_mgr.cc

index 2b0b7501b6e6baa6bb7918ad467cd13c297ee412..48d7f93bae96edd93739ea121954331ac4bc7d08 100644 (file)
@@ -969,12 +969,9 @@ Memfile_LeaseMgr::getLeases4(SubnetID subnet_id) const {
     return (collection);
 }
 
-Lease4Collection
-Memfile_LeaseMgr::getLeases4(const std::string& hostname) const {
-    LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET_HOSTNAME4)
-        .arg(hostname);
-
-    Lease4Collection collection;
+void
+Memfile_LeaseMgr::getLeases4Internal(const std::string& hostname,
+                                    Lease4Collection& collection) const {
     const Lease4StorageHostnameIndex& idx = storage4_.get<HostnameIndexTag>();
     std::pair<Lease4StorageHostnameIndex::const_iterator,
               Lease4StorageHostnameIndex::const_iterator> l =
@@ -983,8 +980,6 @@ Memfile_LeaseMgr::getLeases4(const std::string& hostname) const {
     for (auto lease = l.first; lease != l.second; ++lease) {
         collection.push_back(Lease4Ptr(new Lease4(**lease)));
     }
-
-    return (collection);
 }
 
 Lease4Collection
@@ -1205,12 +1200,9 @@ Memfile_LeaseMgr::getLeases6(SubnetID subnet_id) const {
     return (collection);
 }
 
-Lease6Collection
-Memfile_LeaseMgr::getLeases6(const std::string& hostname) const {
-    LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET_HOSTNAME6)
-        .arg(hostname);
-
-    Lease6Collection collection;
+void
+Memfile_LeaseMgr::getLeases6Internal(const std::string& hostname,
+                                    Lease6Collection& collection) const {
     const Lease6StorageHostnameIndex& idx = storage6_.get<HostnameIndexTag>();
     std::pair<Lease6StorageHostnameIndex::const_iterator,
               Lease6StorageHostnameIndex::const_iterator> l =
@@ -1219,8 +1211,6 @@ Memfile_LeaseMgr::getLeases6(const std::string& hostname) const {
     for (auto lease = l.first; lease != l.second; ++lease) {
         collection.push_back(Lease6Ptr(new Lease6(**lease)));
     }
-
-    return (collection);
 }
 
 Lease6Collection