From: Thomas Jarosch Date: Thu, 14 Oct 2010 13:48:23 +0000 (+0200) Subject: Fix another user-agent pointer bug. Fix user-agent string X-Git-Tag: v1.1~41 X-Git-Url: http://developer.intra2net.com/git/?p=bpdyndnsd;a=commitdiff_plain;h=0e080ce3e114894dac5ee4aca8ec90ed376ecbdc Fix another user-agent pointer bug. Fix user-agent string --- diff --git a/src/ip_addr_helper.cpp b/src/ip_addr_helper.cpp index 429356a..49c4b9a 100644 --- a/src/ip_addr_helper.cpp +++ b/src/ip_addr_helper.cpp @@ -14,6 +14,7 @@ #include #include #include +#include "version_info.h" using namespace std; @@ -556,7 +557,9 @@ CURLcode IPAddrHelper::set_curl_url(CURL * curl_easy_handle, const string& url) */ CURL * IPAddrHelper::init_curl(string& curl_writedata_buff,char* curl_err_buff) const { - string user_agent = "Intra2net AG - Bullet Proof DYNDNS Daemon - 0.1.1"; + ostringstream user_agent_stream; + user_agent_stream << "Intra2net AG - Bullet Proof DYNDNS Daemon - " << MAJOR_VERSION << "." << MINOR_VERSION << endl; + string user_agent = user_agent_stream.str(); CURL *curl_easy_handle = curl_easy_init(); if ( curl_easy_handle == NULL ) @@ -580,7 +583,7 @@ CURL * IPAddrHelper::init_curl(string& curl_writedata_buff,char* curl_err_buff) if ( curlError == CURLE_OK) curlError = curl_easy_setopt(curl_easy_handle,CURLOPT_WRITEDATA,&curl_writedata_buff); if ( curlError == CURLE_OK) - curlError = curl_easy_setopt(curl_easy_handle,CURLOPT_USERAGENT,&user_agent); + curlError = curl_easy_setopt(curl_easy_handle,CURLOPT_USERAGENT,user_agent.c_str()); if ( !Proxy.empty() ) {