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

« back to all changes in this revision

Viewing changes to docs/examples/ftpgetinfo.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: ftpgetinfo.c,v 1.1 2009-09-05 15:23:37 gknauf Exp $
9
8
 */
10
9
 
11
10
#include <stdio.h>
23
22
static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
24
23
{
25
24
  /* we are not interested in the headers itself,
26
 
     so we only return the size we would have saved ... */  
 
25
     so we only return the size we would have saved ... */
27
26
  return (size_t)(size * nmemb);
28
27
}
29
28
 
45
44
    /* No download if the file */
46
45
    curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
47
46
    /* Ask for filetime */
48
 
    curl_easy_setopt(curl, CURLOPT_FILETIME, 1L); 
 
47
    curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
49
48
    /* No header output: TODO 14.1 http-style HEAD output for ftp */
50
49
    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, throw_away);
51
50
    curl_easy_setopt(curl, CURLOPT_HEADER, 0L);