BIND 10 master, updated. feeb79f56b2fd672d8ba20607ed26164d362d0e1 [master] ChangeLog entry for #3050

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Aug 7 10:31:07 UTC 2013


The branch, master has been updated
       via  feeb79f56b2fd672d8ba20607ed26164d362d0e1 (commit)
       via  ff0b9b45869b1d9a4b99e785fbce421e184c2e93 (commit)
       via  35f65cf6f3644e5bc97d058ceffe87b2253305be (commit)
      from  72bcad54040078acf2e30d2f31aa177616a570df (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 feeb79f56b2fd672d8ba20607ed26164d362d0e1
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Aug 7 11:29:11 2013 +0100

    [master] ChangeLog entry for #3050

commit ff0b9b45869b1d9a4b99e785fbce421e184c2e93
Merge: 72bcad5 35f65cf
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Aug 7 11:25:33 2013 +0100

    [master] Merge branch 'trac3050'

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

Summary of changes:
 ChangeLog                               |    4 ++++
 src/lib/hooks/callout_manager.cc        |    8 +++++---
 src/lib/hooks/tests/handles_unittest.cc |   18 ++++++++++++++++++
 3 files changed, 27 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 0ef83af..c575dd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+654.	[bug]		stephen
+	Always clear "skip" flag before calling any callouts on a hook.
+	(Trac# 3050, git ff0b9b45869b1d9a4b99e785fbce421e184c2e93)
+
 653.	[func]		tmark
 	Added initial implementation of D2QueueMgr to
 	DHCP_DDNS.  This class manages the receipt and
diff --git a/src/lib/hooks/callout_manager.cc b/src/lib/hooks/callout_manager.cc
index 5a2126a..df27f45 100644
--- a/src/lib/hooks/callout_manager.cc
+++ b/src/lib/hooks/callout_manager.cc
@@ -113,13 +113,15 @@ CalloutManager::calloutsPresent(int hook_index) const {
 void
 CalloutManager::callCallouts(int hook_index, CalloutHandle& callout_handle) {
 
+    // Clear the "skip" flag so we don't carry state from a previous call.
+    // This is done regardless of whether callouts are present to avoid passing
+    // any state from the previous call of callCallouts().
+    callout_handle.setSkip(false);
+
     // Only initialize and iterate if there are callouts present.  This check
     // also catches the case of an invalid index.
     if (calloutsPresent(hook_index)) {
 
-        // Clear the "skip" flag so we don't carry state from a previous call.
-        callout_handle.setSkip(false);
-
         // Set the current hook index.  This is used should a callout wish to
         // determine to what hook it is attached.
         current_hook_ = hook_index;
diff --git a/src/lib/hooks/tests/handles_unittest.cc b/src/lib/hooks/tests/handles_unittest.cc
index e5364bc..c19dff2 100644
--- a/src/lib/hooks/tests/handles_unittest.cc
+++ b/src/lib/hooks/tests/handles_unittest.cc
@@ -841,6 +841,24 @@ TEST_F(HandlesTest, ReturnSkipClear) {
     EXPECT_FALSE(callout_handle.getSkip());
 }
 
+// Check that the skip flag is cleared when callouts are called - even if
+// there are no callouts.
+
+TEST_F(HandlesTest, NoCalloutsSkipTest) {
+    // Note - no callouts are registered on any hook.
+    CalloutHandle callout_handle(getCalloutManager());
+
+    // Clear the skip flag and call a hook with no callouts.
+    callout_handle.setSkip(false);
+    getCalloutManager()->callCallouts(alpha_index_, callout_handle);
+    EXPECT_FALSE(callout_handle.getSkip());
+
+    // Set the skip flag and call a hook with no callouts.
+    callout_handle.setSkip(true);
+    getCalloutManager()->callCallouts(alpha_index_, callout_handle);
+    EXPECT_FALSE(callout_handle.getSkip());
+}
+
 // The next set of callouts do a similar thing to the above "skip" tests,
 // but alter the value of a string argument.  This is for testing that the
 // a callout is able to change an argument and return it to the caller.



More information about the bind10-changes mailing list