#include <curl/curl.h>

int main(int argc, char *argv[])
{
  CURLcode ret;
  CURL *hnd;
  CURLM *mhnd;
  int running_handles;

  curl_global_init(CURL_GLOBAL_ALL);

  hnd = curl_easy_init();
  curl_easy_setopt(hnd, CURLOPT_URL, "https://www.google.com/");
  curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L);
#if 0
  curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L);
#endif

  mhnd = curl_multi_init();

  curl_multi_add_handle(mhnd, hnd);

  curl_multi_perform(mhnd, &running_handles);
  while(running_handles != 0)
  {
      curl_multi_perform(mhnd, &running_handles);
  }
  curl_multi_remove_handle(mhnd, hnd);
  curl_easy_cleanup(hnd);
  curl_multi_cleanup(mhnd);
  curl_global_cleanup();
  return 0;
}

