From 7de01277ce9f446ebb69cb357f7948383aaa1766 Mon Sep 17 00:00:00 2001 From: Bjoern Sikora Date: Thu, 3 Sep 2009 12:58:57 +0200 Subject: [PATCH] Added constructor to use if auth options are encoded into the url. --- src/httphelper.cpp | 17 ++++++++++++++++- src/httphelper.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/src/httphelper.cpp b/src/httphelper.cpp index 5794362..984e9e6 100644 --- a/src/httphelper.cpp +++ b/src/httphelper.cpp @@ -21,7 +21,7 @@ HTTPHelper::HTTPHelper() /** - * Constructor + * Constructor. Use this constructor if HTTP AUTH should be used. Username and password will then be set as HTTP auth options. * @param _log Logger Object * @param _proxy Proxy to use * @param _proxy_port Proxy Port @@ -40,6 +40,21 @@ HTTPHelper::HTTPHelper(Logger::Ptr _log, const string& _proxy, const int _proxy_ /** + * Constructor. Use this constructor if you have to encode the username and password into the url + * @param _log Logger Object + * @param _proxy Proxy to use + * @param _proxy_port Proxy Port + */ +HTTPHelper::HTTPHelper(Logger::Ptr _log, const string& _proxy, const int _proxy_port) +{ + Log = _log; + Proxy = _proxy; + ProxyPort = _proxy_port; + CurlEasyHandle = init_curl(CurlWritedataBuff, CurlErrBuff); +} + + +/** * Destructor */ HTTPHelper::~HTTPHelper() diff --git a/src/httphelper.h b/src/httphelper.h index 97df6b8..bb1b7c3 100644 --- a/src/httphelper.h +++ b/src/httphelper.h @@ -40,6 +40,8 @@ public: HTTPHelper(Logger::Ptr _log, const std::string& _proxy, const int _proxy_port, const std::string& _username, const std::string& _password); + HTTPHelper(Logger::Ptr _log, const std::string& _proxy, const int _proxy_port); + ~HTTPHelper(); CURL* init_curl(std::string& curl_writedata_buff, char* curl_err_buff) const; -- 1.7.1