Commit d1fdfd86 authored by zhanglikun's avatar zhanglikun
Browse files

[trac598_new] Generate correct answer message for the callback.

parent 744fe91a
......@@ -847,14 +847,20 @@ public:
}
virtual void lookupTimeout() {
callCallback(false);
if (!callback_called_) {
makeSERVFAIL();
callCallback(false);
}
assert(outstanding_events_ > 0);
--outstanding_events_;
stop();
}
virtual void clientTimeout() {
callCallback(false);
if (!callback_called_) {
makeSERVFAIL();
callCallback(false);
}
assert(outstanding_events_ > 0);
--outstanding_events_;
stop();
......@@ -866,7 +872,6 @@ public:
void callCallback(bool success) {
if (!callback_called_) {
callback_called_ = true;
isc::resolve::makeErrorMessage(answer_message_, Rcode::SERVFAIL());
if (success) {
resolvercallback_->success(answer_message_);
} else {
......@@ -908,6 +913,12 @@ public:
stop();
}
// Clear the answer parts of answer_message, and set the rcode
// to servfail
void makeSERVFAIL() {
isc::resolve::makeErrorMessage(answer_message_, Rcode::SERVFAIL());
}
};
}
......
Markdown is supported
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