From: Bjoern Sikora Date: Thu, 3 Sep 2009 10:58:57 +0000 (+0200) Subject: Added constructor to use if auth options are encoded into the url. X-Git-Tag: v1.1~205 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=7de01277ce9f446ebb69cb357f7948383aaa1766;p=bpdyndnsd Added constructor to use if auth options are encoded into the url. --- 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;