Commit 5156bc4d authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[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.
parent 68e9b6e2
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <config/ccsession.h> #include <config/ccsession.h>
#include <cc/data.h> #include <cc/data.h>
#include <cc/proto_defs.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
...@@ -813,7 +814,8 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message, ...@@ -813,7 +814,8 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
command_template_end); command_template_end);
const unsigned int seq = const unsigned int seq =
xfrin_session_->group_sendmsg(notify_command, "Zonemgr", xfrin_session_->group_sendmsg(notify_command, "Zonemgr",
"*", "*"); CC_INSTANCE_WILDCARD,
CC_INSTANCE_WILDCARD, true);
ConstElementPtr env, answer, parsed_answer; ConstElementPtr env, answer, parsed_answer;
xfrin_session_->group_recvmsg(env, answer, false, seq); xfrin_session_->group_recvmsg(env, answer, false, seq);
int rcode; int rcode;
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <dns/rdataclass.h> #include <dns/rdataclass.h>
#include <dns/tsig.h> #include <dns/tsig.h>
#include <cc/proto_defs.h>
#include <server_common/portconfig.h> #include <server_common/portconfig.h>
#include <server_common/keyring.h> #include <server_common/keyring.h>
...@@ -885,6 +887,9 @@ TEST_F(AuthSrvTest, notifyWithoutRecipient) { ...@@ -885,6 +887,9 @@ TEST_F(AuthSrvTest, notifyWithoutRecipient) {
// happens. // happens.
server.processMessage(*io_message, *parse_message, *response_obuffer, server.processMessage(*io_message, *parse_message, *response_obuffer,
&dnsserv); &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()); EXPECT_FALSE(dnsserv.hasAnswer());
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment