From 5e01b672eef01dc5e28b35ca0a5980e3b14f7ef6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Barrette-LaPierre Date: Sun, 26 Aug 2007 11:23:49 -0400 Subject: [PATCH] mErrorBuffer memset patch --- CHANGES | 4 +++- curlpp/CurlHandle.cpp | 3 +++ curlpp/OptionList.cpp | 4 ++-- curlpp/OptionList.hpp | 2 +- curlpp/Types.hpp | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 7665bd0..a9b40be 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ -Changes from version 0.7.0-pre1 to 0.7.1-pre2 +Changes from version 0.7.0-pre1 to 0.7.1 +- mErrorBuffer memset problem fixed + Graziano Giuliani - Fixed HttpPost problem (https://www.rrette.com/pipermail/curlpp/2007-February/000273.html) (Thanks to Gazi Alankus) diff --git a/curlpp/CurlHandle.cpp b/curlpp/CurlHandle.cpp index 8e60551..fa9bc15 100644 --- a/curlpp/CurlHandle.cpp +++ b/curlpp/CurlHandle.cpp @@ -42,6 +42,8 @@ void cURLpp::CurlHandle::perform() void cURLpp::CurlHandle::reset() { curl_easy_reset( mCurl ); + memset(mErrorBuffer,0,CURL_ERROR_SIZE + 1); + errorBuffer( mErrorBuffer ); } CURL * @@ -53,6 +55,7 @@ cURLpp::CurlHandle::getHandle() const cURLpp::CurlHandle::CurlHandle() : mException(NULL) { + memset(mErrorBuffer,0,CURL_ERROR_SIZE + 1); mCurl = curl_easy_init(); runtimeAssert( "Error when trying to curl_easy_init() a handle", mCurl ); errorBuffer( mErrorBuffer ); diff --git a/curlpp/OptionList.cpp b/curlpp/OptionList.cpp index 1e794a8..84e6ce0 100644 --- a/curlpp/OptionList.cpp +++ b/curlpp/OptionList.cpp @@ -76,9 +76,9 @@ cURLpp::OptionList::setOpt( const cURLpp::OptionBase &option ) void -cURLpp::OptionList::getOpt(cURLpp::OptionBase *option) +cURLpp::OptionList::getOpt(cURLpp::OptionBase *option) const { - mapType::iterator pos = mOptions.find(option->getOption()); + mapType::const_iterator pos = mOptions.find(option->getOption()); if( pos != mOptions.end() ) { option->updateMeToOption((*(*pos).second)); diff --git a/curlpp/OptionList.hpp b/curlpp/OptionList.hpp index cc88812..bc105ac 100644 --- a/curlpp/OptionList.hpp +++ b/curlpp/OptionList.hpp @@ -82,7 +82,7 @@ namespace cURLpp * OptionBase. Note that if the option is not set, the option passed in * parameter will be cleared. (See Option::getOpt for more details) */ - virtual void getOpt(OptionBase *option); + virtual void getOpt(OptionBase *option) const; /** * all the options contained by the class will be deleted and we will diff --git a/curlpp/Types.hpp b/curlpp/Types.hpp index 394aa14..70ac00e 100644 --- a/curlpp/Types.hpp +++ b/curlpp/Types.hpp @@ -68,7 +68,7 @@ namespace cURLpp typedef boost::function4< int, double, double, double, double > BoostProgressFunction; #endif - }; -}; + } +} #endif