~ubuntu-branches/ubuntu/natty/curl/natty-security

« back to all changes in this revision

Viewing changes to tests/libtest/lib539.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2010-06-20 13:56:28 UTC
  • mfrom: (3.4.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100620135628-e30tp9jldq6hq985
Tags: 7.21.0-1ubuntu1
* Merge from debian unstable.  Remaining changes: LP: #596334
  - Keep build deps in main:
    - Drop build dependencies: stunnel, libssh2-1-dev
    - Add build-dependency on openssh-server
    - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
  *                            | (__| |_| |  _ <| |___
6
6
  *                             \___|\___/|_| \_\_____|
7
7
  *
8
 
  * $Id: lib539.c,v 1.3 2008-09-22 17:20:29 danf Exp $
9
8
  */
10
9
 
11
10
#include "test.h"
16
15
{
17
16
   CURLcode res;
18
17
   CURL *curl;
19
 
   char *newURL;
20
 
   struct curl_slist *slist;
 
18
   char *newURL = NULL;
 
19
   struct curl_slist *slist = NULL;
21
20
 
22
21
   if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
23
22
     fprintf(stderr, "curl_global_init() failed\n");
33
32
   /*
34
33
    * Begin with cURL set to use a single CWD to the URL's directory.
35
34
    */
36
 
   curl_easy_setopt(curl, CURLOPT_URL, URL);
37
 
   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
38
 
   curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_SINGLECWD);
 
35
   test_setopt(curl, CURLOPT_URL, URL);
 
36
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
 
37
   test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_SINGLECWD);
39
38
 
40
39
   res = curl_easy_perform(curl);
41
40
 
63
62
     return TEST_ERR_MAJOR_BAD;
64
63
   }
65
64
 
66
 
   curl_easy_setopt(curl, CURLOPT_URL, newURL);
67
 
   curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD);
68
 
   curl_easy_setopt(curl, CURLOPT_QUOTE, slist);
 
65
   test_setopt(curl, CURLOPT_URL, newURL);
 
66
   test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD);
 
67
   test_setopt(curl, CURLOPT_QUOTE, slist);
69
68
 
70
69
   res = curl_easy_perform(curl);
71
70
 
 
71
test_cleanup:
 
72
 
72
73
   curl_slist_free_all(slist);
73
 
   free(newURL);
 
74
   if(newURL)
 
75
     free(newURL);
74
76
   curl_easy_cleanup(curl);
75
77
   curl_global_cleanup();
76
78