~ubuntu-branches/ubuntu/dapper/curl/dapper

« back to all changes in this revision

Viewing changes to tests/libtest/lib502.c

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2004-06-04 19:09:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040604190925-wy048bp31320r2z6
Tags: 7.12.0.is.7.11.2-1
* Reverted to version 7.11.2 (closes: #252348).
* Disabled support for libidn (closes: #252367). This is to leave
  curl in unstable as much similar as possible to the one in testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "test.h"
 
2
 
 
3
/*
 
4
 * Get a single URL without select().
 
5
 */
 
6
 
 
7
int test(char *URL)
 
8
{
 
9
  CURL *c;
 
10
  CURLM *m;
 
11
  CURLMcode res;
 
12
  int running=1;
 
13
 
 
14
  curl_global_init(CURL_GLOBAL_ALL);
 
15
  c = curl_easy_init();
 
16
  curl_easy_setopt(c, CURLOPT_URL, URL);
 
17
  m = curl_multi_init();
 
18
 
 
19
  res = curl_multi_add_handle(m, c);
 
20
  while (running) {
 
21
    res = curl_multi_perform(m, &running);
 
22
    if (running <= 0) {
 
23
      fprintf(stderr, "nothing left running.\n");
 
24
      break;
 
25
    }
 
26
  }
 
27
  curl_multi_remove_handle(m, c);
 
28
  curl_easy_cleanup(c);
 
29
  curl_multi_cleanup(m);
 
30
 
 
31
  return res;
 
32
}
 
33