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

« back to all changes in this revision

Viewing changes to tests/libtest/lib554.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: lib554.c,v 1.7 2009-07-22 22:08:01 bagder Exp $
9
8
 */
10
9
 
11
10
#include "test.h"
115
114
  }
116
115
 
117
116
  /* First set the URL that is about to receive our POST. */
118
 
  curl_easy_setopt(curl, CURLOPT_URL, URL);
 
117
  test_setopt(curl, CURLOPT_URL, URL);
119
118
 
120
119
  /* Now specify we want to POST data */
121
 
  curl_easy_setopt(curl, CURLOPT_POST, 1L);
 
120
  test_setopt(curl, CURLOPT_POST, 1L);
122
121
 
123
122
  /* Set the expected POST size */
124
 
  curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
 
123
  test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
125
124
 
126
125
  /* we want to use our own read function */
127
 
  curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
 
126
  test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
128
127
 
129
128
  /* send a multi-part formpost */
130
 
  curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
 
129
  test_setopt(curl, CURLOPT_HTTPPOST, formpost);
131
130
 
132
131
  /* get verbose debug output please */
133
 
  curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
132
  test_setopt(curl, CURLOPT_VERBOSE, 1L);
134
133
 
135
134
  /* include headers in the output */
136
 
  curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
 
135
  test_setopt(curl, CURLOPT_HEADER, 1L);
137
136
 
138
137
  /* Perform the request, res will get the return code */
139
138
  res = curl_easy_perform(curl);
140
139
 
 
140
test_cleanup:
 
141
 
141
142
  /* always cleanup */
142
143
  curl_easy_cleanup(curl);
143
144
  curl_global_cleanup();