~ubuntu-branches/ubuntu/jaunty/cmake/jaunty-security

« back to all changes in this revision

Viewing changes to Source/CTest/Curl/Testing/persistant.c

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2005-03-02 09:22:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050302092244-y6o9j8wr27vqcqvx
Tags: 2.0.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 *                                  _   _ ____  _     
 
3
 *  Project                     ___| | | |  _ \| |    
 
4
 *                             / __| | | | |_) | |    
 
5
 *                            | (__| |_| |  _ <| |___ 
 
6
 *                             \___|\___/|_| \_\_____|
 
7
 *
 
8
 * $Id: persistant.c,v 1.1 2003/01/07 02:17:48 andy Exp $
 
9
 */
 
10
 
 
11
#include <stdio.h>
 
12
 
 
13
#include "curl/curl.h"
 
14
 
 
15
/* to make this work under windows, use the win32-functions from the
 
16
   docs/examples/win32socket.c file as well */
 
17
 
 
18
/* This example REQUIRES libcurl 7.7 or later */
 
19
#if (LIBCURL_VERSION_NUM < 0x070700)
 
20
#error Too old libcurl version, upgrade or stay away.
 
21
#endif
 
22
 
 
23
int main(int argc, char **argv)
 
24
{
 
25
  CURL *curl;
 
26
  CURLcode res;
 
27
 
 
28
#ifdef MALLOCDEBUG
 
29
  /* this sends all memory debug messages to a specified logfile */
 
30
  curl_memdebug("memdump");
 
31
#endif
 
32
 
 
33
  curl_global_init(CURL_GLOBAL_DEFAULT);
 
34
  curl = curl_easy_init();
 
35
  if(curl) {
 
36
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 
37
    curl_easy_setopt(curl, CURLOPT_HEADER, 1);
 
38
 
 
39
    /* get the first document */
 
40
    curl_easy_setopt(curl, CURLOPT_URL, "http://www.cmake.org/");
 
41
    res = curl_easy_perform(curl);
 
42
 
 
43
    /* get another document from the same server using the same
 
44
       connection */
 
45
    curl_easy_setopt(curl, CURLOPT_URL, "http://www.cmake.org/HTML/Index.html");
 
46
    res = curl_easy_perform(curl);
 
47
 
 
48
    /* always cleanup */
 
49
    curl_easy_cleanup(curl);
 
50
  }
 
51
 
 
52
  return 0;
 
53
}