From 113a03a92ec8083a6994c9e0cf3b13f265417310 Mon Sep 17 00:00:00 2001 From: Bjoern Sikora Date: Thu, 17 Sep 2009 17:35:49 +0200 Subject: [PATCH] Last steps on DHS service. --- src/service_dhs.cpp | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/service_dhs.cpp b/src/service_dhs.cpp index 337cca9..46c30bf 100644 --- a/src/service_dhs.cpp +++ b/src/service_dhs.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace ba = boost::algorithm; @@ -147,8 +148,20 @@ int ServiceDhs::perform_update(const std::string& ip) // Check the status code for protocol errors. if ( http_status_code == 200 ) { - // TODO: Account related errors should be handled here! - return 0; + // Get the received http data. + string curl_data = HTTPHelp->get_curl_data(); + + // Search for the following string in the received http data + boost::regex expr_done("Updating ip on .*: done"); + if ( boost::regex_search(curl_data,expr_done) ) + { + // Update successful + return 0; + } + else + { + get_logger()->print_update_failure(url,curl_data); + } } else if ( http_status_code == 401 ) { -- 1.7.1