~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to tests/libtest/lib500.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-04-02 23:35:45 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20090402233545-8xjr3o2sgce5s4bg
Tags: 7.19.4-1
* New upstream release
* Fix "newer bdb version" <explain what you changed and why> 
  (Closes: #517277)
* resolve libtool version confusion, thanks to 
  Stefanos Harhalakis <v13@v13.gr>
* add new dependency on libgcrypt11-dev due to newly arising binary symbols

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;