~ubuntu-branches/ubuntu/hardy/gnupg2/hardy-proposed

« back to all changes in this revision

Viewing changes to keyserver/gpgkeys_curl.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-05-15 13:54:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070515135455-89qfyalmgjy6gcqw
Tags: 2.0.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).
  - Build-depend on libcurl3-gnutls-dev
  - g10/call-agent.c: set DBG_ASSUAN to 0 to suppress a debug message
  - Include /doc files as done with gnupg
  - debian/rules: add doc/com-certs.pem to the docs for gpgsm
  - debian/copyright: update download url
  - debian/README.Debian: remove note the gnupg2 isn't released yet.
  - debian/control: Change Maintainer/XSBC-Original-Maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* gpgkeys_curl.c - fetch a key via libcurl
2
 
 * Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
 
2
 * Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3
3
 *
4
4
 * This file is part of GnuPG.
5
5
 *
112
112
int
113
113
main(int argc,char *argv[])
114
114
{
115
 
  int arg,ret=KEYSERVER_INTERNAL_ERROR;
 
115
  int arg,ret=KEYSERVER_INTERNAL_ERROR,i;
116
116
  char line[MAX_LINE];
117
117
  char *thekey=NULL;
118
118
  long follow_redirects=5;
119
119
  char *proxy=NULL;
 
120
  curl_version_info_data *curldata;
120
121
 
121
122
  console=stderr;
122
123
 
261
262
    }
262
263
 
263
264
  curl_global_init(CURL_GLOBAL_DEFAULT);
 
265
 
264
266
  curl=curl_easy_init();
265
267
  if(!curl)
266
268
    {
269
271
      goto fail;
270
272
    }
271
273
 
 
274
  /* Make sure we have the protocol the user is asking for so we can
 
275
     print a nicer error message. */
 
276
  curldata=curl_version_info(CURLVERSION_NOW);
 
277
  for(i=0;curldata->protocols[i];i++)
 
278
    if(strcasecmp(curldata->protocols[i],opt->scheme)==0)
 
279
      break;
 
280
 
 
281
  if(curldata->protocols[i]==NULL)
 
282
    {
 
283
      fprintf(console,"gpgkeys: protocol `%s' not supported\n",opt->scheme);
 
284
      ret=KEYSERVER_SCHEME_NOT_FOUND;
 
285
      goto fail;
 
286
    }
 
287
 
272
288
  if(follow_redirects)
273
289
    {
274
290
      curl_easy_setopt(curl,CURLOPT_FOLLOWLOCATION,1);