From fbf8f1663fe768b45553f337e9bcea26124b0aa3 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 6 Jul 2016 12:04:15 +0300 Subject: [PATCH] Initialize mMaxUpload/mMaxDownload to 0 (fix #81) --- libgrive/src/http/Agent.cc | 5 +++++ libgrive/src/http/Agent.hh | 1 + libgrive/src/http/CurlAgent.cc | 2 +- libgrive/src/protocol/AuthAgent.cc | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libgrive/src/http/Agent.cc b/libgrive/src/http/Agent.cc index ba04846..39276ac 100644 --- a/libgrive/src/http/Agent.cc +++ b/libgrive/src/http/Agent.cc @@ -25,6 +25,11 @@ namespace gr { namespace http { +Agent::Agent() +{ + mMaxUpload = mMaxDownload = 0; +} + long Agent::Put( const std::string& url, const std::string& data, diff --git a/libgrive/src/http/Agent.hh b/libgrive/src/http/Agent.hh index ce1883b..8268e19 100644 --- a/libgrive/src/http/Agent.hh +++ b/libgrive/src/http/Agent.hh @@ -38,6 +38,7 @@ protected: unsigned mMaxUpload, mMaxDownload ; public : + Agent() ; virtual ~Agent() {} virtual ResponseLog* GetLog() const = 0 ; diff --git a/libgrive/src/http/CurlAgent.cc b/libgrive/src/http/CurlAgent.cc index 3a27955..3bfdfca 100644 --- a/libgrive/src/http/CurlAgent.cc +++ b/libgrive/src/http/CurlAgent.cc @@ -72,7 +72,7 @@ struct CurlAgent::Impl static struct curl_slist* SetHeader( CURL* handle, const Header& hdr ); -CurlAgent::CurlAgent() : +CurlAgent::CurlAgent() : Agent(), m_pimpl( new Impl ) { m_pimpl->curl = ::curl_easy_init(); diff --git a/libgrive/src/protocol/AuthAgent.cc b/libgrive/src/protocol/AuthAgent.cc index 65665f7..f2f59d6 100644 --- a/libgrive/src/protocol/AuthAgent.cc +++ b/libgrive/src/protocol/AuthAgent.cc @@ -32,6 +32,7 @@ namespace gr { using namespace http ; AuthAgent::AuthAgent( OAuth2& auth, Agent *real_agent ) : + Agent(), m_auth ( auth ), m_agent ( real_agent ) {