Added constant accessors to HTTP::Downloader

This commit is contained in:
Thulinma 2020-09-14 10:44:34 +02:00
parent 66dff82144
commit c5d0a9a8ad
2 changed files with 4 additions and 2 deletions

View file

@ -61,6 +61,7 @@ namespace HTTP{
/// Returns a reference to the internal Socket::Connection class instance. /// Returns a reference to the internal Socket::Connection class instance.
Socket::Connection &Downloader::getSocket(){return S;} Socket::Connection &Downloader::getSocket(){return S;}
const Socket::Connection &Downloader::getSocket() const{return S;}
Downloader::~Downloader(){S.close();} Downloader::~Downloader(){S.close();}
@ -280,7 +281,7 @@ namespace HTTP{
return nbLink; 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 // returns true if the request is complete
bool Downloader::continueNonBlocking(Util::DataCallback &cb){ bool Downloader::continueNonBlocking(Util::DataCallback &cb){
while (true){ while (true){

View file

@ -39,9 +39,10 @@ namespace HTTP{
void setHeader(const std::string &name, const std::string &val); void setHeader(const std::string &name, const std::string &val);
void clearHeaders(); void clearHeaders();
bool canRequest(const HTTP::URL &link); bool canRequest(const HTTP::URL &link);
bool completed(){return isComplete;} bool completed() const{return isComplete;}
Parser &getHTTP(); Parser &getHTTP();
Socket::Connection &getSocket(); Socket::Connection &getSocket();
const Socket::Connection &getSocket() const;
uint32_t retryCount, dataTimeout; uint32_t retryCount, dataTimeout;
bool isProxied() const; bool isProxied() const;
const HTTP::URL & lastURL(); const HTTP::URL & lastURL();