Browse Source

[2977] Implemented DNS Update response parsing.

Marcin Siodelski 12 years ago
parent
commit
cf1828a29f
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/bin/d2/dns_client.cc

+ 7 - 2
src/bin/d2/dns_client.cc

@@ -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.