Changeset - a63920e965e5
[Not reviewed]
0 1 0
Jan Kaluza - 10 years ago 2016-01-02 20:06:57
jkaluza@redhat.com
Disable useless curl verbose output
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
backends/twitter/HTTPRequest.cpp
Show inline comments
 
@@ -35,38 +35,38 @@ int HTTPRequest::curlCallBack(char* data, size_t size, size_t nmemb, HTTPRequest
 
    if(obj && data) {
 
       obj->callbackdata.append(data, size*nmemb);
 
	   writtenSize = (int)(size*nmemb);
 
    }
 
    return writtenSize;
 
}
 

	
 

	
 
bool HTTPRequest::GET(std::string url, 	std::string &data)
 
{
 
	if(curlhandle) {
 
		curl_easy_setopt(curlhandle, CURLOPT_CUSTOMREQUEST, NULL);
 
		curl_easy_setopt(curlhandle, CURLOPT_ENCODING, "");
 
		
 
		data = "";
 
		callbackdata = "";
 
		memset(curl_errorbuffer, 0, 1024);
 
		
 
		curl_easy_setopt(curlhandle, CURLOPT_ERRORBUFFER, curl_errorbuffer);
 
		curl_easy_setopt(curlhandle, CURLOPT_WRITEFUNCTION, curlCallBack);
 
		curl_easy_setopt(curlhandle, CURLOPT_WRITEDATA, this);
 
			
 
		/* Set http request and url */
 
		curl_easy_setopt(curlhandle, CURLOPT_HTTPGET, 1);
 
		curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1);
 
// 		curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1);
 
		curl_easy_setopt(curlhandle, CURLOPT_URL, url.c_str());
 
		
 
		/* Send http request and return status*/
 
		if(CURLE_OK == curl_easy_perform(curlhandle)) {
 
			data = callbackdata;
 
			return true;
 
		}
 
	} else {
 
		LOG4CXX_ERROR(logger, "CURL not initialized!")
 
		strcpy(curl_errorbuffer, "CURL not initialized!");
 
	}
 
	return false;
 
}
0 comments (0 inline, 0 general)