summaryrefslogtreecommitdiffabout
path: root/lib/consumer.cc
Side-by-side diff
Diffstat (limited to 'lib/consumer.cc') (more/less context) (show whitespace changes)
-rw-r--r--lib/consumer.cc25
1 files changed, 5 insertions, 20 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc
index 7881f5f..20f4174 100644
--- a/lib/consumer.cc
+++ b/lib/consumer.cc
@@ -3,4 +3,5 @@
#include <cstring>
#include <opkele/util.h>
+#include <opkele/curl.h>
#include <opkele/exception.h>
#include <opkele/data.h>
@@ -8,6 +9,4 @@
#include <openssl/sha.h>
#include <openssl/hmac.h>
-#include <curl/curl.h>
-
#include <iostream>
@@ -63,18 +62,4 @@ namespace opkele {
};
- class curl_t {
- public:
- CURL *_c;
-
- curl_t() : _c(0) { }
- curl_t(CURL *c) : _c(c) { }
- ~curl_t() throw() { if(_c) curl_easy_cleanup(_c); }
-
- curl_t& operator=(CURL *c) { if(_c) curl_easy_cleanup(_c); _c=c; return *this; }
-
- operator const CURL*(void) const { return _c; }
- operator CURL*(void) { return _c; }
- };
-
static CURLcode curl_misc_sets(CURL* c) {
CURLcode r;
@@ -117,5 +102,5 @@ namespace opkele {
"&openid.dh_consumer_public=";
request += util::url_encode(util::bignum_to_base64(dh->pub_key));
- curl_t curl = curl_easy_init();
+ util::curl_t curl = curl_easy_init();
if(!curl)
throw exception_curl(OPKELE_CP_ "failed to curl_easy_init()");
@@ -277,5 +262,5 @@ namespace opkele {
}
}
- curl_t curl = curl_easy_init();
+ util::curl_t curl = curl_easy_init();
if(!curl)
throw exception_curl(OPKELE_CP_ "failed to curl_easy_init()");
@@ -310,5 +295,5 @@ namespace opkele {
server.erase();
delegate.erase();
- curl_t curl = curl_easy_init();
+ util::curl_t curl = curl_easy_init();
if(!curl)
throw exception_curl(OPKELE_CP_ "failed to curl_easy_init()");
@@ -416,5 +401,5 @@ namespace opkele {
string consumer_t::canonicalize(const string& url) {
string rv = normalize(url);
- curl_t curl = curl_easy_init();
+ util::curl_t curl = curl_easy_init();
if(!curl)
throw exception_curl(OPKELE_CP_ "failed to curl_easy_init()");