From: JINMEI Tatuya Date: Thu, 28 Mar 2013 02:48:37 +0000 (-0700) Subject: [2562] set want_answer to true in group_sendmsg() for notify handling. X-Git-Tag: bind10-1.1.0beta1-release~18^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5156bc4dbb05a5803b87e57751ffc7ba94e4ac98;p=thirdparty%2Fkea.git [2562] set want_answer to true in group_sendmsg() for notify handling. without this we can't catch the case where zonemgr isn't running timely. a unit test is updated to check that condition, too. --- diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 5613f3a1cf..3fe9b9c6c4 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -22,6 +22,7 @@ #include #include +#include #include @@ -813,7 +814,8 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message, command_template_end); const unsigned int seq = xfrin_session_->group_sendmsg(notify_command, "Zonemgr", - "*", "*"); + CC_INSTANCE_WILDCARD, + CC_INSTANCE_WILDCARD, true); ConstElementPtr env, answer, parsed_answer; xfrin_session_->group_recvmsg(env, answer, false, seq); int rcode; diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index a478f4b746..8ca65fde87 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -26,6 +26,8 @@ #include #include +#include + #include #include @@ -885,6 +887,9 @@ TEST_F(AuthSrvTest, notifyWithoutRecipient) { // happens. server.processMessage(*io_message, *parse_message, *response_obuffer, &dnsserv); + // want_answer should have been set to true so auth can catch it if zonemgr + // is not running. + EXPECT_TRUE(notify_session.wasAnswerWanted()); EXPECT_FALSE(dnsserv.hasAnswer()); }