BIND 10 master, updated. 3ccbb10693264fa527ce7fe82da1b6a4a569e7c8 [master] Corrected valgrind complaint in dhcpsrv unittest.

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Feb 12 13:52:52 UTC 2014


The branch, master has been updated
       via  3ccbb10693264fa527ce7fe82da1b6a4a569e7c8 (commit)
      from  26808da540dbf7b5ac1127303ea4562309949d05 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3ccbb10693264fa527ce7fe82da1b6a4a569e7c8
Author: Thomas Markwalder <tmark at isc.org>
Date:   Wed Feb 12 08:51:48 2014 -0500

    [master] Corrected valgrind complaint in dhcpsrv unittest.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcpsrv/d2_client.h              |    6 ++++++
 src/lib/dhcpsrv/tests/d2_udp_unittest.cc |    5 +++++
 2 files changed, 11 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/d2_client.h b/src/lib/dhcpsrv/d2_client.h
index 639747a..7c0bd0d 100644
--- a/src/lib/dhcpsrv/d2_client.h
+++ b/src/lib/dhcpsrv/d2_client.h
@@ -382,6 +382,12 @@ public:
     /// supplied as the manager cannot know how an application should deal
     /// with send failures.
     /// @param io_service IOService to be used for sender IO event processing
+    /// @warning It is up to the invoking layer to ensure the io_service
+    /// instance used outlives the D2ClientMgr send mode. When the send mode
+    /// is exited, either expliclity by callind stopSender() or implicitly
+    /// through D2CLientMgr destruction, any ASIO objects such as sockets or
+    /// timers will be closed and released.  If the io_service goes out of scope
+    /// first this behavior could be unpredictable.
     ///
     /// @throw D2ClientError if sender instance is null. Underlying layer
     /// may throw NCRSenderExceptions exceptions.
diff --git a/src/lib/dhcpsrv/tests/d2_udp_unittest.cc b/src/lib/dhcpsrv/tests/d2_udp_unittest.cc
index 66d2125..6969b28 100644
--- a/src/lib/dhcpsrv/tests/d2_udp_unittest.cc
+++ b/src/lib/dhcpsrv/tests/d2_udp_unittest.cc
@@ -319,6 +319,11 @@ TEST_F(D2ClientMgrTest, udpSendExternalIOService) {
 
     // select_fd should evaluate to not ready to read.
     selectCheck(false);
+
+    // Explicitly stop the sender. This ensures the sender's
+    // ASIO socket is closed prior to the local io_service
+    // instance goes out of scope.
+    ASSERT_NO_THROW(stopSender());
 }
 
 /// @brief Checks that D2ClientMgr invokes the client error handler



More information about the bind10-changes mailing list