~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to tests/libtest/lib500.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: lib500.c,v 1.7 2008-05-22 21:49:52 danf Exp $
 
8
 * $Id: lib500.c,v 1.9 2008-09-20 04:26:56 yangtse Exp $
9
9
 */
10
10
 
11
11
#include "test.h"
12
12
 
 
13
#include "memdebug.h"
 
14
 
13
15
int test(char *URL)
14
16
{
15
17
  CURLcode res;
16
18
  CURL *curl;
 
19
  char *ipstr=NULL;
17
20
 
18
21
  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
19
22
    fprintf(stderr, "curl_global_init() failed\n");
31
34
 
32
35
  res = curl_easy_perform(curl);
33
36
 
34
 
  curl_easy_cleanup(curl);  
 
37
  if(!res) {
 
38
    FILE *moo;
 
39
    res = curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ipstr);
 
40
    moo = fopen(libtest_arg2, "wb");
 
41
    if(moo) {
 
42
      fprintf(moo, "IP: %s\n", ipstr);
 
43
      fclose(moo);
 
44
    }
 
45
  }
 
46
 
 
47
  curl_easy_cleanup(curl);
35
48
  curl_global_cleanup();
36
49
 
37
50
  return (int)res;