Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / tests / libtest / lib549.c
blob7c54977b91a7069287ab4126666626772d943136
1 /*****************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * $Id: lib549.c,v 1.1.1.1 2008-09-23 16:32:06 hoffman Exp $
10 * argv1 = URL
11 * argv2 = proxy
12 * argv3 = non-zero means ASCII transfer
15 #include "test.h"
17 int test(char *URL)
19 CURLcode res;
20 CURL *curl;
22 if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
23 fprintf(stderr, "curl_global_init() failed\n");
24 return TEST_ERR_MAJOR_BAD;
27 if ((curl = curl_easy_init()) == NULL) {
28 fprintf(stderr, "curl_easy_init() failed\n");
29 curl_global_cleanup();
30 return TEST_ERR_MAJOR_BAD;
33 curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
34 curl_easy_setopt(curl, CURLOPT_URL, URL);
35 curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
36 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
37 if(libtest_arg3)
38 /* enable ascii/text mode */
39 curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
41 res = curl_easy_perform(curl);
43 curl_easy_cleanup(curl);
44 curl_global_cleanup();
46 return (int)res;