return;
}
+ bool send_answer = true;
try {
// update per opcode statistics counter. This can only be reliable
// after TSIG check succeeds.
impl_->counters_.inc(message->getOpcode());
- bool send_answer = true;
if (message->getOpcode() == Opcode::NOTIFY()) {
send_answer = impl_->processNotify(io_message, message, buffer,
tsig_context);
buffer, tsig_context);
}
}
-
- impl_->resumeServer(server, message, send_answer);
- } catch (const isc::Unexpected&) {
- // If the error was unexpected protocol, don't even bother responding
- // (If we see other Unexpected's here, we should probably change to
- // a specific exception for unknown protocol)
- impl_->resumeServer(server, message, false);
} catch (const isc::Exception&) {
- // For ISC Exceptions, respond with servfail
makeErrorMessage(message, buffer, Rcode::SERVFAIL());
- impl_->resumeServer(server, message, true);
} catch (...) {
- // Drop the query on any other exceptions (do we want servfail here
- // too?)
- impl_->resumeServer(server, message, false);
+ makeErrorMessage(message, buffer, Rcode::SERVFAIL());
}
+ impl_->resumeServer(server, message, send_answer);
}
bool
setupThrow(&server, CONFIG_INMEMORY_EXAMPLE, throw_at_find_zone,
false);
- EXPECT_FALSE(dnsserv.hasAnswer());
+ processAndCheckSERVFAIL();
}
// Throw isc::Exception at getOrigin(), should result in SERVFAIL
createDataFromFile("nsec3query_nodnssec_fromWire.wire");
setupThrow(&server, CONFIG_INMEMORY_EXAMPLE, throw_at_find,
false);
- EXPECT_FALSE(dnsserv.hasAnswer());
+ processAndCheckSERVFAIL();
}
// Throw isc::Exception in findNSEC3(), should result in SERVFAIL
createRequestPacket(request_message, IPPROTO_UDP);
setupThrow(&server, CONFIG_INMEMORY_EXAMPLE, throw_at_find_nsec3,
false);
- EXPECT_FALSE(dnsserv.hasAnswer());
+ processAndCheckSERVFAIL();
}
}