author | Michael Krelin <hacker@klever.net> | 2007-11-24 12:02:50 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-11-24 12:02:50 (UTC) |
commit | 986274e9f9a8e2ef0f92b08d2d2c9485bd19adec (patch) (side-by-side diff) | |
tree | 72b3d134d9d635b2aadbdebf615e1717dd9d683b /lib | |
parent | ef66d79bf58f099179a932ca80d07ca93a42909c (diff) | |
download | libopkele-986274e9f9a8e2ef0f92b08d2d2c9485bd19adec.zip libopkele-986274e9f9a8e2ef0f92b08d2d2c9485bd19adec.tar.gz libopkele-986274e9f9a8e2ef0f92b08d2d2c9485bd19adec.tar.bz2 |
moved curl_t wrapper to util namespace
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | lib/consumer.cc | 25 |
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 @@ -4,2 +4,3 @@ #include <opkele/util.h> +#include <opkele/curl.h> #include <opkele/exception.h> @@ -9,4 +10,2 @@ #include <openssl/hmac.h> -#include <curl/curl.h> - #include <iostream> @@ -64,16 +63,2 @@ 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) { @@ -118,3 +103,3 @@ namespace opkele { 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) @@ -278,3 +263,3 @@ namespace opkele { } - curl_t curl = curl_easy_init(); + util::curl_t curl = curl_easy_init(); if(!curl) @@ -311,3 +296,3 @@ namespace opkele { delegate.erase(); - curl_t curl = curl_easy_init(); + util::curl_t curl = curl_easy_init(); if(!curl) @@ -417,3 +402,3 @@ namespace opkele { string rv = normalize(url); - curl_t curl = curl_easy_init(); + util::curl_t curl = curl_easy_init(); if(!curl) |