Update all config.h usage.
[m6w6/libmemcached] / libtest / http.cc
index d7faf19d90d44508feea535e04ff565d5b26f158..59497d69760d3417f44f85d398bfc99ed69b0282 100644 (file)
@@ -34,7 +34,7 @@
  *
  */
 
-#include <config.h>
+#include "mem_config.h"
 
 #include <libtest/common.h>
 
@@ -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
   }