From c5d0a9a8ad1a817eaae8ef322c2a05d81c846d7d Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 14 Sep 2020 10:44:34 +0200 Subject: [PATCH] Added constant accessors to HTTP::Downloader --- lib/downloader.cpp | 3 ++- lib/downloader.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/downloader.cpp b/lib/downloader.cpp index 7d9c39ef..45ed307e 100644 --- a/lib/downloader.cpp +++ b/lib/downloader.cpp @@ -61,6 +61,7 @@ namespace HTTP{ /// Returns a reference to the internal Socket::Connection class instance. Socket::Connection &Downloader::getSocket(){return S;} + const Socket::Connection &Downloader::getSocket() const{return S;} Downloader::~Downloader(){S.close();} @@ -280,7 +281,7 @@ namespace HTTP{ return nbLink; } - // continue handling a request, origininally set up by the getNonBlocking() function + // continue handling a request, originally set up by the getNonBlocking() function // returns true if the request is complete bool Downloader::continueNonBlocking(Util::DataCallback &cb){ while (true){ diff --git a/lib/downloader.h b/lib/downloader.h index 5f49ccdb..34c6ad8e 100644 --- a/lib/downloader.h +++ b/lib/downloader.h @@ -39,9 +39,10 @@ namespace HTTP{ void setHeader(const std::string &name, const std::string &val); void clearHeaders(); bool canRequest(const HTTP::URL &link); - bool completed(){return isComplete;} + bool completed() const{return isComplete;} Parser &getHTTP(); Socket::Connection &getSocket(); + const Socket::Connection &getSocket() const; uint32_t retryCount, dataTimeout; bool isProxied() const; const HTTP::URL & lastURL();