Commit d22c9609 authored by Jelte Jansen's avatar Jelte Jansen

[trac491] review comments, the smaller issues

parent c9a06623
......@@ -265,12 +265,8 @@ public:
answer_message->setHeaderFlag(Message::HEADERFLAG_QR);
answer_message->setHeaderFlag(Message::HEADERFLAG_RA);
if (rd) {
answer_message->setHeaderFlag(Message::HEADERFLAG_RD);
}
if (cd) {
answer_message->setHeaderFlag(Message::HEADERFLAG_CD);
}
answer_message->setHeaderFlag(Message::HEADERFLAG_RD, rd);
answer_message->setHeaderFlag(Message::HEADERFLAG_CD, cd);
// Now we can clear the buffer and render the new message into it
buffer->clear();
......
......@@ -268,6 +268,7 @@ private:
// TODO should use NSAS
zone_servers_.push_back(addr_t(addr_str, 53));
found_ns_address = true;
break;
}
}
}
......
......@@ -45,7 +45,6 @@ MessageCache::lookup(const isc::dns::Name& qname,
isc::dns::Message& response)
{
std::string entry_name = genCacheEntryName(qname, qtype);
std::cout << "[XX] MESSAGECACHE LOOKUP: " << entry_name << std::endl;
HashKey entry_key = HashKey(entry_name, RRClass(message_class_));
MessageEntryPtr msg_entry = message_table_.get(entry_key);
if(msg_entry) {
......@@ -60,8 +59,6 @@ bool
MessageCache::update(const Message& msg) {
QuestionIterator iter = msg.beginQuestion();
std::string entry_name = genCacheEntryName((*iter)->getName(), (*iter)->getType());
std::cout << "[XX] MESSAGECACHE UPDATE: " << entry_name << std::endl;
std::cout << "[XX] FOR MESSAGE:" << std::endl;
std::cout << msg.toText();
HashKey entry_key = HashKey(entry_name, RRClass(message_class_));
......
......@@ -202,7 +202,6 @@ ResolverCache::lookupClosestRRset(const isc::dns::Name& qname,
bool
ResolverCache::update(const isc::dns::Message& msg) {
QuestionIterator iter = msg.beginQuestion();
RRClass c = (*iter)->getClass();
ResolverClassCache* cc = getClassCache((*iter)->getClass());
if (cc) {
return (cc->update(msg));
......
......@@ -52,6 +52,7 @@ void initResponseMessage(const isc::dns::Message& query_message,
{
response_message.setOpcode(query_message.getOpcode());
response_message.setQid(query_message.getQid());
assert(response_message.getRRCount(Message::SECTION_QUESTION) == 0);
response_message.appendSection(Message::SECTION_QUESTION,
query_message);
}
......
......@@ -56,7 +56,7 @@ void makeErrorMessage(isc::dns::MessagePtr answer_message,
/// \param query_message The query message to take the Question, Qid,
/// and Opcode from.
/// \param response_message The fresh response message to initialize
/// (must be type Message::RENDER)
/// (must be in RENDER mode)
void initResponseMessage(const isc::dns::Message& query_message,
isc::dns::Message& response_message);
......@@ -73,7 +73,7 @@ void initResponseMessage(const isc::dns::Message& query_message,
///
/// \param question The question to place in the Question section
/// \param response_message The fresh response message to initialize
/// (must be type Message::RENDER)
/// (must be in RENDER mode)
void initResponseMessage(const isc::dns::Question& question,
isc::dns::Message& response_message);
......
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