X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fhttp.cc;h=29873dc67f5e959cbe1ab555bd91e7905f9aeb2b;hb=6730933820b3c3f7b016b4d33a209198d195a37a;hp=621c714c2f1c616166a105d21b7c0fca90d6bdbd;hpb=743e893ecbbaacd66d2832e9c3ae16404422a173;p=awesomized%2Flibmemcached diff --git a/libtest/http.cc b/libtest/http.cc index 621c714c..29873dc6 100644 --- a/libtest/http.cc +++ b/libtest/http.cc @@ -97,14 +97,14 @@ static void init(CURL *curl, const std::string& url) (void)http_get_result_callback; (void)curl; (void)url; +#if defined(HAVE_LIBCURL) && HAVE_LIBCURL if (HAVE_LIBCURL) { -#if defined(HAVE_LIBCURL) && HAVE_LIBCURL assert(curl); curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, YATL_USERAGENT); -#endif } +#endif } HTTP::HTTP(const std::string& url_arg) : @@ -118,9 +118,9 @@ bool GET::execute() { (void)init; +#if defined(HAVE_LIBCURL) && HAVE_LIBCURL if (HAVE_LIBCURL) { -#if defined(HAVE_LIBCURL) && HAVE_LIBCURL CURL *curl= curl_easy_init(); init(curl, url()); @@ -134,17 +134,17 @@ bool GET::execute() curl_easy_cleanup(curl); return bool(retref == CURLE_OK); -#endif } +#endif return false; } bool POST::execute() { +#if defined(HAVE_LIBCURL) && HAVE_LIBCURL if (HAVE_LIBCURL) { -#if defined(HAVE_LIBCURL) && HAVE_LIBCURL CURL *curl= curl_easy_init();; init(curl, url()); @@ -158,17 +158,17 @@ bool POST::execute() curl_easy_cleanup(curl); return bool(retref == CURLE_OK); -#endif } +#endif return false; } bool TRACE::execute() { +#if defined(HAVE_LIBCURL) && HAVE_LIBCURL if (HAVE_LIBCURL) { -#if defined(HAVE_LIBCURL) && HAVE_LIBCURL CURL *curl= curl_easy_init();; init(curl, url()); @@ -183,18 +183,18 @@ bool TRACE::execute() curl_easy_cleanup(curl); return retref == CURLE_OK; -#endif } +#endif return false; } bool HEAD::execute() { +#if defined(HAVE_LIBCURL) && HAVE_LIBCURL if (HAVE_LIBCURL) { -#if defined(HAVE_LIBCURL) && HAVE_LIBCURL - CURL *curl= curl_easy_init();; + CURL *curl= curl_easy_init(); init(curl, url()); @@ -207,8 +207,8 @@ bool HEAD::execute() curl_easy_cleanup(curl); return retref == CURLE_OK; -#endif } +#endif return false; }