vchar_t *_body= (vchar_t*)data;
_body->resize(size * nmemb);
- memcpy(&_body[0], ptr, _body->size());
+ memcpy(&(*_body)[0], ptr, _body->size());
return _body->size();
}
(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) :
{
(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());
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());
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());
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());
curl_easy_cleanup(curl);
return retref == CURLE_OK;
-#endif
}
+#endif
return false;
}