bool TestExtCurl::test_curl_multi_add_handle() {
  Resource mh = f_curl_multi_init();
  Variant c1 = f_curl_init(String(get_request_uri()));
  Variant c2 = f_curl_init(String(get_request_uri()));
  f_curl_multi_add_handle(mh, c1.toResource());
  f_curl_multi_add_handle(mh, c2.toResource());
  return Count(true);
}
bool TestExtCurl::test_curl_multi_select() {
  Object mh = f_curl_multi_init();
  Variant c1 = f_curl_init(String(get_request_uri()));
  Variant c2 = f_curl_init(String(get_request_uri()));
  f_curl_multi_add_handle(mh, c1);
  f_curl_multi_add_handle(mh, c2);
  VS(f_curl_multi_select(mh), 0);
  return Count(true);
}
bool TestExtCurl::test_curl_multi_exec() {
  Resource mh = f_curl_multi_init();
  Variant c1 = f_curl_init(String(get_request_uri()));
  Variant c2 = f_curl_init(String(get_request_uri()));
  f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true);
  f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true);
  f_curl_multi_add_handle(mh, c1.toResource());
  f_curl_multi_add_handle(mh, c2.toResource());

  Variant still_running;
  do {
    f_curl_multi_exec(mh, ref(still_running));
  } while (more(still_running, 0));

  return Count(true);
}
bool TestExtCurl::test_curl_multi_info_read() {
  Object mh = f_curl_multi_init();
  Variant c1 = f_curl_init(String(get_request_uri()));
  Variant c2 = f_curl_init(String(get_request_uri()));
  f_curl_setopt(c1, k_CURLOPT_RETURNTRANSFER, true);
  f_curl_setopt(c2, k_CURLOPT_RETURNTRANSFER, true);
  f_curl_multi_add_handle(mh, c1);
  f_curl_multi_add_handle(mh, c2);

  Variant still_running;
  do {
    f_curl_multi_exec(mh, ref(still_running));
  } while (more(still_running, 0));

  Variant ret = f_curl_multi_info_read(mh);
  VS(ret[s_result], 0);
  return Count(true);
}