~ubuntu-branches/ubuntu/gutsy/curl/gutsy

« back to all changes in this revision

Viewing changes to tests/libtest/lib523.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-16 15:16:54 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070516151654-jo48r81zempo1qav
Tags: 7.16.2-3ubuntu1
* Merge with Debian; remaining changes:
  - Drop the stunnel build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
 
6
 *                             \___|\___/|_| \_\_____|
 
7
 *
 
8
 * $Id: lib523.c,v 1.3 2006-10-25 09:20:44 yangtse Exp $
 
9
 */
 
10
 
1
11
#include "test.h"
2
12
 
3
13
int test(char *URL)
4
14
{
5
15
  CURLcode res;
6
 
  CURL *curl = curl_easy_init();
 
16
  CURL *curl;
 
17
 
 
18
  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
 
19
    fprintf(stderr, "curl_global_init() failed\n");
 
20
    return TEST_ERR_MAJOR_BAD;
 
21
  }
 
22
 
 
23
  if ((curl = curl_easy_init()) == NULL) {
 
24
    fprintf(stderr, "curl_easy_init() failed\n");
 
25
    curl_global_cleanup();
 
26
    return TEST_ERR_MAJOR_BAD;
 
27
  }
 
28
 
7
29
  curl_easy_setopt(curl, CURLOPT_PROXY, arg2);
8
30
  curl_easy_setopt(curl, CURLOPT_URL, URL);
9
31
  curl_easy_setopt(curl, CURLOPT_PORT, 19999);
11
33
  curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE);
12
34
 
13
35
  res = curl_easy_perform(curl);
 
36
 
14
37
  curl_easy_cleanup(curl);
 
38
  curl_global_cleanup();
 
39
 
15
40
  return (int)res;
16
41
}
17
42