X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fhttp.cc;h=59497d69760d3417f44f85d398bfc99ed69b0282;hb=1b26fc8f15dfdb529a4a418322e489c990e564b4;hp=d7faf19d90d44508feea535e04ff565d5b26f158;hpb=a833bac7bfb7b59bb95e84cc8989d0edae6a6136;p=awesomized%2Flibmemcached diff --git a/libtest/http.cc b/libtest/http.cc index d7faf19d..59497d69 100644 --- a/libtest/http.cc +++ b/libtest/http.cc @@ -34,7 +34,7 @@ * */ -#include +#include "mem_config.h" #include @@ -68,7 +68,7 @@ static void initialize_curl_startup() } static pthread_once_t start_key_once= PTHREAD_ONCE_INIT; -void initialize_curl(void) +static void initialize_curl(void) { int ret; if ((ret= pthread_once(&start_key_once, initialize_curl_startup)) != 0) @@ -82,20 +82,21 @@ namespace http { #define YATL_USERAGENT "YATL/1.0" -extern "C" size_t - http_get_result_callback(void *ptr, size_t size, size_t nmemb, void *data) - { - vchar_t *_body= (vchar_t*)data; - - _body->resize(size * nmemb); - memcpy(&_body[0], ptr, _body->size()); +static size_t http_get_result_callback(void *ptr, size_t size, size_t nmemb, void *data) +{ + vchar_t *_body= (vchar_t*)data; - return _body->size(); - } + _body->resize(size * nmemb); + memcpy(&_body[0], ptr, _body->size()); + return _body->size(); +} static void init(CURL *curl, const std::string& url) { + (void)http_get_result_callback; + (void)curl; + (void)url; if (HAVE_LIBCURL) { #if defined(HAVE_LIBCURL) && HAVE_LIBCURL @@ -132,7 +133,7 @@ bool GET::execute() curl_easy_cleanup(curl); - return retref == CURLE_OK; + return bool(retref == CURLE_OK); #endif } @@ -155,6 +156,8 @@ bool POST::execute() curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, _response); curl_easy_cleanup(curl); + + return bool(retref == CURLE_OK); #endif }