From befe35f2765b654c42fdbdab292aaf26e1dc7b0b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 9 Oct 2015 00:34:33 +0100 Subject: Remove unnecessary wrappers, adhocutil provides suitable ones --- project2/url/curlHelper.cpp | 24 ++++++------------------ project2/url/curlHelper.h | 3 --- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/project2/url/curlHelper.cpp b/project2/url/curlHelper.cpp index a4ca4d7..d6ca64b 100644 --- a/project2/url/curlHelper.cpp +++ b/project2/url/curlHelper.cpp @@ -63,12 +63,12 @@ void VariableCurlHelper::setCurlOpts(AdHoc::Net::CurlHandle * c, ExecContext * ec) const { CurlHelper::setCurlOpts(c, ec); - setopt_s(c, CURLOPT_USERAGENT, userAgent(ec)); - setopt_s(c, CURLOPT_PROXY, proxy(ec)); - setopt_s(c, CURLOPT_REFERER, referer(ec)); - setopt_s(c, CURLOPT_COOKIEFILE, cookieJar(ec)); - setopt_s(c, CURLOPT_COOKIEJAR, cookieJar(ec)); - setopt_l(c, CURLOPT_TIMEOUT_MS, timeout(ec)); + c->setopt(CURLOPT_USERAGENT, userAgent(ec)); + c->setopt(CURLOPT_PROXY, proxy(ec)); + c->setopt(CURLOPT_REFERER, referer(ec)); + c->setopt(CURLOPT_COOKIEFILE, cookieJar(ec)); + c->setopt(CURLOPT_COOKIEJAR, cookieJar(ec)); + c->setopt(CURLOPT_TIMEOUT_MS, timeout(ec)); } void @@ -99,18 +99,6 @@ Curl::setSendHandler(const SendHandler & h) setopt(CURLOPT_READFUNCTION, &curlSendHelperHandle); } -void -VariableCurlHelper::setopt_s(AdHoc::Net::CurlHandle * c, CURLoption o, const char * v) -{ - c->setopt(o, v); -} - -void -VariableCurlHelper::setopt_l(AdHoc::Net::CurlHandle * c, CURLoption o, int64_t v) -{ - c->setopt(o, (long)v); -} - std::string VariableCurlHelper::getUrl(ExecContext * ec) const { diff --git a/project2/url/curlHelper.h b/project2/url/curlHelper.h index 95b24a6..ad73a31 100644 --- a/project2/url/curlHelper.h +++ b/project2/url/curlHelper.h @@ -49,9 +49,6 @@ class VariableCurlHelper : public CurlHelper { virtual std::string getUrl(ExecContext *) const override; private: - static void setopt_s(AdHoc::Net::CurlHandle *, CURLoption, const char *); - static void setopt_l(AdHoc::Net::CurlHandle *, CURLoption, int64_t); - const Variable userAgent; const Variable cookieJar; const Variable proxy; -- cgit v1.2.3