2004-12-22 18:12:23 +01:00
|
|
|
/* gpgkeys_curl.c - fetch a key via libcurl
|
2008-04-14 21:41:40 +02:00
|
|
|
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
2004-12-22 00:39:57 +01:00
|
|
|
*
|
|
|
|
* This file is part of GnuPG.
|
|
|
|
*
|
|
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-04 21:49:40 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-12-22 00:39:57 +01:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GnuPG is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-04 21:49:40 +02:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2006-09-22 13:39:45 +02:00
|
|
|
*
|
|
|
|
* In addition, as a special exception, the Free Software Foundation
|
|
|
|
* gives permission to link the code of the keyserver helper tools:
|
|
|
|
* gpgkeys_ldap, gpgkeys_curl and gpgkeys_hkp with the OpenSSL
|
|
|
|
* project's "OpenSSL" library (or with modified versions of it that
|
|
|
|
* use the same license as the "OpenSSL" library), and distribute the
|
|
|
|
* linked executables. You must obey the GNU General Public License
|
|
|
|
* in all respects for all of the code used other than "OpenSSL". If
|
|
|
|
* you modify this file, you may extend this exception to your version
|
|
|
|
* of the file, but you are not obligated to do so. If you do not
|
|
|
|
* wish to do so, delete this exception statement from your version.
|
2004-12-22 00:39:57 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#ifdef HAVE_GETOPT_H
|
|
|
|
#include <getopt.h>
|
|
|
|
#endif
|
2006-04-26 23:48:29 +02:00
|
|
|
#ifdef HAVE_LIBCURL
|
2004-12-22 00:39:57 +01:00
|
|
|
#include <curl/curl.h>
|
2006-04-26 23:48:29 +02:00
|
|
|
#else
|
|
|
|
#include "curl-shim.h"
|
2005-02-11 19:05:13 +01:00
|
|
|
#endif
|
2004-12-22 00:39:57 +01:00
|
|
|
#include "keyserver.h"
|
|
|
|
#include "ksutil.h"
|
|
|
|
|
|
|
|
extern char *optarg;
|
|
|
|
extern int optind;
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
static FILE *input,*output,*console;
|
2004-12-22 00:39:57 +01:00
|
|
|
static CURL *curl;
|
2005-03-17 17:42:41 +01:00
|
|
|
static struct ks_options *opt;
|
2004-12-22 00:39:57 +01:00
|
|
|
|
|
|
|
static int
|
|
|
|
get_key(char *getkey)
|
|
|
|
{
|
|
|
|
CURLcode res;
|
|
|
|
char errorbuffer[CURL_ERROR_SIZE];
|
2005-03-17 17:42:41 +01:00
|
|
|
char request[MAX_URL];
|
2005-04-17 03:52:04 +02:00
|
|
|
struct curl_writer_ctx ctx;
|
|
|
|
|
|
|
|
memset(&ctx,0,sizeof(ctx));
|
2004-12-22 00:39:57 +01:00
|
|
|
|
|
|
|
if(strncmp(getkey,"0x",2)==0)
|
|
|
|
getkey+=2;
|
|
|
|
|
|
|
|
fprintf(output,"KEY 0x%s BEGIN\n",getkey);
|
|
|
|
|
2005-06-24 01:42:35 +02:00
|
|
|
sprintf(request,"%s://%s%s%s%s",opt->scheme,opt->host,
|
|
|
|
opt->port?":":"",opt->port?opt->port:"",opt->path?opt->path:"/");
|
2004-12-22 00:39:57 +01:00
|
|
|
|
|
|
|
curl_easy_setopt(curl,CURLOPT_URL,request);
|
2005-04-16 20:50:46 +02:00
|
|
|
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,curl_writer);
|
2005-04-17 03:52:04 +02:00
|
|
|
ctx.stream=output;
|
|
|
|
curl_easy_setopt(curl,CURLOPT_FILE,&ctx);
|
2004-12-22 00:39:57 +01:00
|
|
|
curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,errorbuffer);
|
|
|
|
|
|
|
|
res=curl_easy_perform(curl);
|
2005-07-20 23:48:28 +02:00
|
|
|
if(res!=CURLE_OK)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
2005-12-08 00:00:30 +01:00
|
|
|
fprintf(console,"gpgkeys: %s fetch error %d: %s\n",opt->scheme,
|
|
|
|
res,errorbuffer);
|
|
|
|
fprintf(output,"\nKEY 0x%s FAILED %d\n",getkey,curl_err_to_gpg_err(res));
|
2004-12-22 00:39:57 +01:00
|
|
|
}
|
2005-12-19 20:39:32 +01:00
|
|
|
else
|
2005-12-07 23:25:58 +01:00
|
|
|
{
|
2005-12-19 20:39:32 +01:00
|
|
|
curl_writer_finalize(&ctx);
|
|
|
|
if(!ctx.flags.done)
|
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: no key data found for %s\n",request);
|
|
|
|
fprintf(output,"\nKEY 0x%s FAILED %d\n",
|
|
|
|
getkey,KEYSERVER_KEY_NOT_FOUND);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fprintf(output,"\nKEY 0x%s END\n",getkey);
|
2005-12-07 23:25:58 +01:00
|
|
|
}
|
2004-12-22 00:39:57 +01:00
|
|
|
|
2005-12-08 00:00:30 +01:00
|
|
|
return curl_err_to_gpg_err(res);
|
2004-12-22 00:39:57 +01:00
|
|
|
}
|
|
|
|
|
2013-11-18 14:09:47 +01:00
|
|
|
static void
|
2004-12-22 00:39:57 +01:00
|
|
|
show_help (FILE *fp)
|
|
|
|
{
|
2009-05-11 05:21:41 +02:00
|
|
|
fprintf (fp,"-h, --help\thelp\n");
|
|
|
|
fprintf (fp,"-V\t\tmachine readable version\n");
|
|
|
|
fprintf (fp,"--version\thuman readable version\n");
|
|
|
|
fprintf (fp,"-o\t\toutput to this file\n");
|
2004-12-22 00:39:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc,char *argv[])
|
|
|
|
{
|
2007-03-14 05:24:55 +01:00
|
|
|
int arg,ret=KEYSERVER_INTERNAL_ERROR,i;
|
2004-12-22 00:39:57 +01:00
|
|
|
char line[MAX_LINE];
|
|
|
|
char *thekey=NULL;
|
2005-03-17 17:42:41 +01:00
|
|
|
long follow_redirects=5;
|
2005-06-24 01:42:35 +02:00
|
|
|
char *proxy=NULL;
|
2007-03-14 05:24:55 +01:00
|
|
|
curl_version_info_data *curldata;
|
2009-05-28 18:20:49 +02:00
|
|
|
struct curl_slist *headers=NULL;
|
2004-12-22 00:39:57 +01:00
|
|
|
|
|
|
|
console=stderr;
|
|
|
|
|
|
|
|
/* Kludge to implement standard GNU options. */
|
|
|
|
if (argc > 1 && !strcmp (argv[1], "--version"))
|
|
|
|
{
|
2013-11-18 14:09:47 +01:00
|
|
|
printf ("gpgkeys_curl (%s) %s\n", GNUPG_NAME, VERSION);
|
2009-05-11 05:21:41 +02:00
|
|
|
printf ("Uses: %s\n", curl_version());
|
2004-12-22 00:39:57 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else if (argc > 1 && !strcmp (argv[1], "--help"))
|
|
|
|
{
|
|
|
|
show_help (stdout);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
while((arg=getopt(argc,argv,"hVo:"))!=-1)
|
|
|
|
switch(arg)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
case 'h':
|
|
|
|
show_help (console);
|
|
|
|
return KEYSERVER_OK;
|
|
|
|
|
|
|
|
case 'V':
|
|
|
|
fprintf(stdout,"%d\n%s\n",KEYSERVER_PROTO_VERSION,VERSION);
|
|
|
|
return KEYSERVER_OK;
|
|
|
|
|
|
|
|
case 'o':
|
2004-12-22 06:23:22 +01:00
|
|
|
output=fopen(optarg,"wb");
|
2004-12-22 00:39:57 +01:00
|
|
|
if(output==NULL)
|
|
|
|
{
|
2012-06-05 19:29:22 +02:00
|
|
|
fprintf(console,"gpgkeys: Cannot open output file '%s': %s\n",
|
2004-12-22 00:39:57 +01:00
|
|
|
optarg,strerror(errno));
|
|
|
|
return KEYSERVER_INTERNAL_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(argc>optind)
|
|
|
|
{
|
|
|
|
input=fopen(argv[optind],"r");
|
|
|
|
if(input==NULL)
|
|
|
|
{
|
2012-06-05 19:29:22 +02:00
|
|
|
fprintf(console,"gpgkeys: Cannot open input file '%s': %s\n",
|
2004-12-22 00:39:57 +01:00
|
|
|
argv[optind],strerror(errno));
|
|
|
|
return KEYSERVER_INTERNAL_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(input==NULL)
|
|
|
|
input=stdin;
|
|
|
|
|
|
|
|
if(output==NULL)
|
|
|
|
output=stdout;
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
opt=init_ks_options();
|
|
|
|
if(!opt)
|
|
|
|
return KEYSERVER_NO_MEMORY;
|
|
|
|
|
2004-12-22 00:39:57 +01:00
|
|
|
/* Get the command and info block */
|
|
|
|
|
|
|
|
while(fgets(line,MAX_LINE,input)!=NULL)
|
|
|
|
{
|
2005-03-17 17:42:41 +01:00
|
|
|
int err;
|
2005-01-14 00:37:26 +01:00
|
|
|
char option[MAX_OPTION+1];
|
2004-12-22 00:39:57 +01:00
|
|
|
|
|
|
|
if(line[0]=='\n')
|
|
|
|
break;
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
err=parse_ks_options(line,opt);
|
|
|
|
if(err>0)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
2005-03-17 17:42:41 +01:00
|
|
|
ret=err;
|
|
|
|
goto fail;
|
2004-12-22 00:39:57 +01:00
|
|
|
}
|
2005-03-17 17:42:41 +01:00
|
|
|
else if(err==0)
|
|
|
|
continue;
|
2004-12-22 00:39:57 +01:00
|
|
|
|
2005-01-14 00:37:26 +01:00
|
|
|
if(sscanf(line,"OPTION %" MKSTRING(MAX_OPTION) "s\n",option)==1)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
|
|
|
int no=0;
|
2005-01-14 00:37:26 +01:00
|
|
|
char *start=&option[0];
|
2004-12-22 00:39:57 +01:00
|
|
|
|
2005-01-14 00:37:26 +01:00
|
|
|
option[MAX_OPTION]='\0';
|
2004-12-22 00:39:57 +01:00
|
|
|
|
2005-01-14 00:37:26 +01:00
|
|
|
if(strncasecmp(option,"no-",3)==0)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
|
|
|
no=1;
|
2005-01-14 00:37:26 +01:00
|
|
|
start=&option[3];
|
2004-12-22 00:39:57 +01:00
|
|
|
}
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(strncasecmp(start,"http-proxy",10)==0)
|
2004-12-24 20:48:36 +01:00
|
|
|
{
|
2005-06-24 01:42:35 +02:00
|
|
|
/* Safe to not check the return code of strdup() here.
|
|
|
|
If it fails, we simply won't use a proxy. */
|
2004-12-24 20:48:36 +01:00
|
|
|
if(no)
|
|
|
|
{
|
2005-06-24 01:42:35 +02:00
|
|
|
free(proxy);
|
|
|
|
proxy=strdup("");
|
2004-12-24 20:48:36 +01:00
|
|
|
}
|
2005-06-24 01:42:35 +02:00
|
|
|
else if(start[10]=='=')
|
2005-04-16 20:50:46 +02:00
|
|
|
{
|
2005-06-24 01:42:35 +02:00
|
|
|
if(strlen(&start[11])<MAX_PROXY)
|
2005-04-16 20:50:46 +02:00
|
|
|
{
|
2005-06-24 01:42:35 +02:00
|
|
|
free(proxy);
|
|
|
|
proxy=strdup(&start[11]);
|
2005-04-16 20:50:46 +02:00
|
|
|
}
|
|
|
|
}
|
2004-12-24 20:48:36 +01:00
|
|
|
}
|
2004-12-22 20:19:10 +01:00
|
|
|
else if(strncasecmp(start,"follow-redirects",16)==0)
|
|
|
|
{
|
|
|
|
if(no)
|
|
|
|
follow_redirects=0;
|
|
|
|
else if(start[16]=='=')
|
|
|
|
follow_redirects=atoi(&start[17]);
|
|
|
|
else if(start[16]=='\0')
|
|
|
|
follow_redirects=-1;
|
2004-12-22 00:39:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(!opt->scheme)
|
2004-12-22 18:12:23 +01:00
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: no scheme supplied!\n");
|
2005-03-17 17:42:41 +01:00
|
|
|
ret=KEYSERVER_SCHEME_NOT_FOUND;
|
|
|
|
goto fail;
|
2004-12-22 18:12:23 +01:00
|
|
|
}
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(!opt->host)
|
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: no keyserver host provided\n");
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(opt->timeout && register_timeout()==-1)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: unable to register timeout handler\n");
|
|
|
|
return KEYSERVER_INTERNAL_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
curl_global_init(CURL_GLOBAL_DEFAULT);
|
2007-03-14 05:24:55 +01:00
|
|
|
|
2004-12-22 00:39:57 +01:00
|
|
|
curl=curl_easy_init();
|
|
|
|
if(!curl)
|
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: unable to initialize curl\n");
|
|
|
|
ret=KEYSERVER_INTERNAL_ERROR;
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2007-03-14 05:24:55 +01:00
|
|
|
/* Make sure we have the protocol the user is asking for so we can
|
|
|
|
print a nicer error message. */
|
|
|
|
curldata=curl_version_info(CURLVERSION_NOW);
|
|
|
|
for(i=0;curldata->protocols[i];i++)
|
|
|
|
if(strcasecmp(curldata->protocols[i],opt->scheme)==0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if(curldata->protocols[i]==NULL)
|
|
|
|
{
|
2012-06-05 19:29:22 +02:00
|
|
|
fprintf(console,"gpgkeys: protocol '%s' not supported\n",opt->scheme);
|
2007-03-14 05:24:55 +01:00
|
|
|
ret=KEYSERVER_SCHEME_NOT_FOUND;
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2004-12-22 20:19:10 +01:00
|
|
|
if(follow_redirects)
|
|
|
|
{
|
2008-04-14 21:41:40 +02:00
|
|
|
curl_easy_setopt(curl,CURLOPT_FOLLOWLOCATION,1L);
|
2004-12-22 20:19:10 +01:00
|
|
|
if(follow_redirects>0)
|
|
|
|
curl_easy_setopt(curl,CURLOPT_MAXREDIRS,follow_redirects);
|
|
|
|
}
|
|
|
|
|
2005-06-24 01:42:35 +02:00
|
|
|
if(opt->auth)
|
|
|
|
curl_easy_setopt(curl,CURLOPT_USERPWD,opt->auth);
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(opt->debug)
|
2005-01-22 04:27:19 +01:00
|
|
|
{
|
2005-08-04 05:59:16 +02:00
|
|
|
fprintf(console,"gpgkeys: curl version = %s\n",curl_version());
|
2005-01-22 04:27:19 +01:00
|
|
|
curl_easy_setopt(curl,CURLOPT_STDERR,console);
|
2008-04-14 21:41:40 +02:00
|
|
|
curl_easy_setopt(curl,CURLOPT_VERBOSE,1L);
|
2005-01-22 04:27:19 +01:00
|
|
|
}
|
|
|
|
|
2008-04-14 21:41:40 +02:00
|
|
|
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,(long)opt->flags.check_cert);
|
2005-03-17 17:42:41 +01:00
|
|
|
curl_easy_setopt(curl,CURLOPT_CAINFO,opt->ca_cert_file);
|
2005-02-12 04:15:02 +01:00
|
|
|
|
2009-05-28 18:20:49 +02:00
|
|
|
/* Avoid caches to get the most recent copy of the key. This is bug
|
|
|
|
#1061. In pre-curl versions of the code, we didn't do it. Then
|
|
|
|
we did do it (as a curl default) until curl changed the default.
|
|
|
|
Now we're doing it again, but in such a way that changing
|
|
|
|
defaults in the future won't impact us. We set both the Pragma
|
|
|
|
and Cache-Control versions of the header, so we're good with both
|
|
|
|
HTTP 1.0 and 1.1. */
|
|
|
|
headers=curl_slist_append(headers,"Pragma: no-cache");
|
|
|
|
if(headers)
|
|
|
|
headers=curl_slist_append(headers,"Cache-Control: no-cache");
|
|
|
|
|
|
|
|
if(!headers)
|
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: out of memory when building HTTP headers\n");
|
|
|
|
ret=KEYSERVER_NO_MEMORY;
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
curl_easy_setopt(curl,CURLOPT_HTTPHEADER,headers);
|
|
|
|
|
2005-06-24 01:42:35 +02:00
|
|
|
if(proxy)
|
2004-12-24 20:48:36 +01:00
|
|
|
curl_easy_setopt(curl,CURLOPT_PROXY,proxy);
|
2004-12-22 20:19:10 +01:00
|
|
|
|
2004-12-22 00:39:57 +01:00
|
|
|
/* If it's a GET or a SEARCH, the next thing to come in is the
|
|
|
|
keyids. If it's a SEND, then there are no keyids. */
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(opt->action==KS_GET)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
|
|
|
/* Eat the rest of the file */
|
|
|
|
for(;;)
|
|
|
|
{
|
|
|
|
if(fgets(line,MAX_LINE,input)==NULL)
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(line[0]=='\n' || line[0]=='\0')
|
|
|
|
break;
|
|
|
|
|
|
|
|
if(!thekey)
|
|
|
|
{
|
|
|
|
thekey=strdup(line);
|
|
|
|
if(!thekey)
|
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: out of memory while "
|
|
|
|
"building key list\n");
|
|
|
|
ret=KEYSERVER_NO_MEMORY;
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Trim the trailing \n */
|
|
|
|
thekey[strlen(line)-1]='\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf(console,
|
|
|
|
"gpgkeys: this keyserver type only supports key retrieval\n");
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(!thekey)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
|
|
|
fprintf(console,"gpgkeys: invalid keyserver instructions\n");
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Send the response */
|
|
|
|
|
|
|
|
fprintf(output,"VERSION %d\n",KEYSERVER_PROTO_VERSION);
|
|
|
|
fprintf(output,"PROGRAM %s\n\n",VERSION);
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
if(opt->verbose)
|
2004-12-22 00:39:57 +01:00
|
|
|
{
|
2005-03-17 17:42:41 +01:00
|
|
|
fprintf(console,"Scheme:\t\t%s\n",opt->scheme);
|
|
|
|
fprintf(console,"Host:\t\t%s\n",opt->host);
|
|
|
|
if(opt->port)
|
|
|
|
fprintf(console,"Port:\t\t%s\n",opt->port);
|
|
|
|
if(opt->path)
|
|
|
|
fprintf(console,"Path:\t\t%s\n",opt->path);
|
2004-12-22 00:39:57 +01:00
|
|
|
fprintf(console,"Command:\tGET\n");
|
|
|
|
}
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
set_timeout(opt->timeout);
|
2004-12-22 00:39:57 +01:00
|
|
|
|
|
|
|
ret=get_key(thekey);
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
|
|
|
free(thekey);
|
|
|
|
|
|
|
|
if(input!=stdin)
|
|
|
|
fclose(input);
|
|
|
|
|
|
|
|
if(output!=stdout)
|
|
|
|
fclose(output);
|
|
|
|
|
2005-03-17 17:42:41 +01:00
|
|
|
free_ks_options(opt);
|
|
|
|
|
2009-05-28 18:20:49 +02:00
|
|
|
curl_slist_free_all(headers);
|
|
|
|
|
2005-02-05 16:04:59 +01:00
|
|
|
if(curl)
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
|
2005-06-24 01:42:35 +02:00
|
|
|
free(proxy);
|
|
|
|
|
2004-12-22 00:39:57 +01:00
|
|
|
curl_global_cleanup();
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|