/**
* 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)
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));
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));
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)
* Get member LastWebcheck
* @return LastWebcheck
*/
-int IPAddrHelper::get_last_webcheck() const
+time_t IPAddrHelper::get_last_webcheck() const
{
return LastWebcheck;
}