Finished fine tuning due to linter output.
[bpdyndnsd] / src / ip_addr_helper.cpp
index af88ee4..5070a94 100644 (file)
@@ -36,7 +36,7 @@ IPAddrHelper::IPAddrHelper()
 /**
  * Constructor.
  */
-IPAddrHelper::IPAddrHelper(const Logger::Ptr _log, const string& _webcheck_url, const string& _webcheck_url_alt, const int _webcheck_interval, const int _last_webcheck ,const bool _use_ipv6, const string& _proxy, const int _proxy_port)
+IPAddrHelper::IPAddrHelper(const Logger::Ptr _log, const string& _webcheck_url, const string& _webcheck_url_alt, const int _webcheck_interval, const time_t _last_webcheck ,const bool _use_ipv6, const string& _proxy, const int _proxy_port)
     : Log(_log)
     , WebcheckIpUrl(_webcheck_url)
     , WebcheckIpUrlAlt(_webcheck_url_alt)
@@ -225,7 +225,7 @@ string IPAddrHelper::get_local_wan_nic_ip() const
         if ( address_family == AF_INET )
         {
             // Translate the address to a protocol independent representation (dottet format). Copy address into ip_addr_buff.
-            ret_val = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), ip_addr_buff, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+            ret_val = getnameinfo(ifa->ifa_addr, (socklen_t)sizeof(struct sockaddr_in), ip_addr_buff, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
             if ( ret_val != 0 )
             {
                 Log->print_error_getting_local_wan_ip("getnameinfo", gai_strerror(ret_val));
@@ -248,7 +248,7 @@ string IPAddrHelper::get_local_wan_nic_ip() const
         else if ( (address_family == AF_INET6) && (UseIPv6) )
         {
             // Translate the address to a protocol independent representation (dottet format). Copy address into ip_addr_buff.
-            ret_val = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6), ip_addr_buff, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+            ret_val = getnameinfo(ifa->ifa_addr, (socklen_t)sizeof(struct sockaddr_in6), ip_addr_buff, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
             if ( ret_val != 0 )
             {
                 Log->print_error_getting_local_wan_ip("getnameinfo", gai_strerror(ret_val));
@@ -559,10 +559,7 @@ CURL * IPAddrHelper::init_curl(string& curl_writedata_buff,char* curl_err_buff)
         return NULL;
     }
 
-    CURLcode curlError = CURLE_OK;
-
-    if ( curlError == CURLE_OK )
-        curlError = curl_easy_setopt(curl_easy_handle,CURLOPT_NOPROGRESS,1);
+    CURLcode curlError = curl_easy_setopt(curl_easy_handle,CURLOPT_NOPROGRESS,1);
     if ( curlError == CURLE_OK)
         curlError = curl_easy_setopt(curl_easy_handle,CURLOPT_CONNECTTIMEOUT,5);
     if ( curlError == CURLE_OK)
@@ -617,7 +614,7 @@ size_t IPAddrHelper::http_receive( const char *inBuffer, size_t size, size_t nme
  * Get member LastWebcheck
  * @return LastWebcheck
  */
-int IPAddrHelper::get_last_webcheck() const
+time_t IPAddrHelper::get_last_webcheck() const
 {
     return LastWebcheck;
 }