]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2977] Implemented DNS Update response parsing.
authorMarcin Siodelski <marcin@isc.org>
Tue, 2 Jul 2013 22:39:15 +0000 (00:39 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 2 Jul 2013 22:39:15 +0000 (00:39 +0200)
src/bin/d2/dns_client.cc

index ba5e9a32e9f1ae2da89433100846f257193149f3..38d80c34cde5b33b43f3a63a53f58d82f8034b45 100644 (file)
@@ -43,8 +43,13 @@ DNSClient::DNSClient(D2UpdateMessagePtr& response_placeholder,
 
 void
 DNSClient::operator()(IOFetch::Result result) {
-    // @todo Do something useful here. One of the useful things will be to parse
-    // incoming message if the result is SUCCESS.
+    // @todo More sanity checks here. Also, there is a question, what happens if
+    // the exception is thrown here.
+
+    if (result == IOFetch::SUCCESS) {
+        InputBuffer response_buf(in_buf_->getData(), in_buf_->getLength());
+        response_->fromWire(response_buf);
+    }
 
     // Once we are done with internal business, let's call a callback supplied
     // by a caller.