diff --git a/libtransport/HTTPRequest.cpp b/libtransport/HTTPRequest.cpp index e63bf0ef206805790ecd6ef3c06f3596a98a7abf..d9b30bdbd686752c4d1f777292b6bcbb4ccb61a2 100644 --- a/libtransport/HTTPRequest.cpp +++ b/libtransport/HTTPRequest.cpp @@ -21,6 +21,14 @@ HTTPRequest::HTTPRequest(Type type, const std::string &url) { init(); } +HTTPRequest::~HTTPRequest() { + if (curlhandle) { + LOG4CXX_INFO(logger, "Cleaning up CURL handle"); + curl_easy_cleanup(curlhandle); + curlhandle = NULL; + } +} + bool HTTPRequest::init() { curlhandle = curl_easy_init(); if (curlhandle) { @@ -85,6 +93,7 @@ bool HTTPRequest::GET(std::string url, std::string &data) { LOG4CXX_ERROR(logger, "CURL not initialized!") strcpy(curl_errorbuffer, "CURL not initialized!"); } + LOG4CXX_ERROR(logger, "Error fetching " << url); return false; }