1 /* Prevent warnings on Visual Studio */
2 struct _RPC_ASYNC_STATE
;
13 curl
= curl_easy_init();
16 /* Get curl 7.9.2 from sunet.se's FTP site: */
17 curl_easy_setopt(curl
, CURLOPT_VERBOSE
, 1);
18 curl_easy_setopt(curl
, CURLOPT_HEADER
, 1);
19 curl_easy_setopt(curl
, CURLOPT_URL
,
20 "ftp://public.kitware.com/pub/cmake/cygwin/setup.hint");
21 res
= curl_easy_perform(curl
);
24 printf("Error fetching: ftp://public.kitware.com/pub/cmake/cygwin/setup.hint\n");
29 curl_easy_cleanup(curl
);
33 printf("Cannot create curl object\n");
48 if ( getenv("HTTP_PROXY") )
51 if (getenv("HTTP_PROXY_PORT") )
53 sprintf(proxy
, "%s:%s", getenv("HTTP_PROXY"), getenv("HTTP_PROXY_PORT"));
57 sprintf(proxy
, "%s", getenv("HTTP_PROXY"));
59 if ( getenv("HTTP_PROXY_TYPE") )
61 /* HTTP/SOCKS4/SOCKS5 */
62 if ( strcmp(getenv("HTTP_PROXY_TYPE"), "HTTP") == 0 )
66 else if ( strcmp(getenv("HTTP_PROXY_TYPE"), "SOCKS4") == 0 )
70 else if ( strcmp(getenv("HTTP_PROXY_TYPE"), "SOCKS5") == 0 )
77 curl
= curl_easy_init();
80 curl_easy_setopt(curl
, CURLOPT_VERBOSE
, 1);
81 curl_easy_setopt(curl
, CURLOPT_HEADER
, 1);
86 curl_easy_setopt(curl
, CURLOPT_PROXY
, proxy
);
90 curl_easy_setopt(curl
, CURLOPT_PROXYTYPE
, CURLPROXY_SOCKS4
);
93 curl_easy_setopt(curl
, CURLOPT_PROXYTYPE
, CURLPROXY_SOCKS5
);
96 curl_easy_setopt(curl
, CURLOPT_PROXYTYPE
, CURLPROXY_HTTP
);
100 /* get the first document */
101 curl_easy_setopt(curl
, CURLOPT_URL
, "http://www.cmake.org/page1.html");
102 res
= curl_easy_perform(curl
);
105 printf("Error fetching: http://www.cmake.org/page1.html\n");
109 /* get another document from the same server using the same
112 curl_easy_setopt(curl, CURLOPT_URL, "http://www.cmake.org/page2.html");
113 res = curl_easy_perform(curl);
116 printf("Error fetching: http://www.cmake.org/page2.html\n");
122 curl_easy_cleanup(curl
);
126 printf("Cannot create curl object\n");
133 int main(/*int argc, char **argv*/)
136 curl_global_init(CURL_GLOBAL_DEFAULT
);
137 retVal
+= GetWebFile();
139 /* Do not check the output of FTP socks5 cannot handle FTP yet */
141 /* do not test ftp right now because we don't enable that port */
142 curl_global_cleanup();