This is a debug message issued when the Dhcp-Ddns application encounters an
unrecoverable error from within the event loop.
+% DHCP_DDNS_INVALID_RESPONSE received response to DNS Update message is malformed: %1
+This is a debug message issued when the DHCP-DDNS application encountered an error
+while decoding a response to DNS Update message. Typically, this error will be
+encountered when a response message is malformed.
+
% DHCP_DDNS_PROCESS_INIT application init invoked
This is a debug message issued when the Dhcp-Ddns application enters
its init method.
// PERFORMANCE OF THIS SOFTWARE.
#include <d2/dns_client.h>
+#include <d2/d2_log.h>
#include <dns/messagerenderer.h>
namespace isc {
void
DNSClientImpl::operator()(asiodns::IOFetch::Result result) {
- // @todo More sanity checks here. Also, there is a question, what happens if
- // the exception is thrown here.
-
+ // Get the status from IO. If no success, we just call user's callback
+ // and pass the status code.
DNSClient::Status status = getStatus(result);
-
if (status == DNSClient::SUCCESS) {
InputBuffer response_buf(in_buf_->getData(), in_buf_->getLength());
+ // Server's response may be corrupted. In such case, fromWire will
+ // throw an exception. We want to catch this exception to return
+ // appropriate status code to the caller and log this event.
try {
response_->fromWire(response_buf);
+
} catch (const Exception& ex) {
status = DNSClient::INVALID_RESPONSE;
+ LOG_DEBUG(dctl_logger, DBGLVL_TRACE_DETAIL,
+ DHCP_DDNS_INVALID_RESPONSE).arg(ex.what());
+
}
}