Fixed file descriptor leak in Downloader class
This commit is contained in:
parent
92d59befa6
commit
984f5b7e29
2 changed files with 8 additions and 0 deletions
|
@ -65,6 +65,13 @@ namespace HTTP{
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Downloader::~Downloader(){
|
||||||
|
#ifdef SSL
|
||||||
|
if (ssl){S_SSL.close();}
|
||||||
|
#endif
|
||||||
|
S.close();
|
||||||
|
}
|
||||||
|
|
||||||
/// Sends a request for the given URL, does no waiting.
|
/// Sends a request for the given URL, does no waiting.
|
||||||
void Downloader::doRequest(const HTTP::URL &link, const std::string &method,
|
void Downloader::doRequest(const HTTP::URL &link, const std::string &method,
|
||||||
const std::string &body){
|
const std::string &body){
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace HTTP{
|
||||||
class Downloader{
|
class Downloader{
|
||||||
public:
|
public:
|
||||||
Downloader();
|
Downloader();
|
||||||
|
~Downloader();
|
||||||
std::string &data();
|
std::string &data();
|
||||||
const std::string &const_data() const;
|
const std::string &const_data() const;
|
||||||
void doRequest(const HTTP::URL &link, const std::string &method = "",
|
void doRequest(const HTTP::URL &link, const std::string &method = "",
|
||||||
|
|
Loading…
Add table
Reference in a new issue