aboutsummaryrefslogtreecommitdiffstats
path: root/keyserver/curl-shim.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2006-02-21 16:16:09 +0000
committerDavid Shaw <[email protected]>2006-02-21 16:16:09 +0000
commite4206de3f50195955efd7ddb324719eb9d163416 (patch)
tree3b249dc446aa1b6ffe2b4434804490264341f234 /keyserver/curl-shim.c
parent* gpgv.c: Stub keyserver_import_ldap. (diff)
downloadgnupg-e4206de3f50195955efd7ddb324719eb9d163416.tar.gz
gnupg-e4206de3f50195955efd7ddb324719eb9d163416.zip
* curl-shim.h, curl-shim.c (curl_easy_init, curl_easy_setopt,
curl_easy_perform): Add CURLOPT_VERBOSE and CURLOPT_STDERR for easier debugging.
Diffstat (limited to 'keyserver/curl-shim.c')
-rw-r--r--keyserver/curl-shim.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/keyserver/curl-shim.c b/keyserver/curl-shim.c
index cf8309b12..fa38abab3 100644
--- a/keyserver/curl-shim.c
+++ b/keyserver/curl-shim.c
@@ -1,7 +1,7 @@
/* curl-shim.c - Implement a small subset of the curl API in terms of
* the iobuf HTTP API
*
- * Copyright (C) 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2006 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -88,7 +88,13 @@ curl_global_cleanup(void) {}
CURL *
curl_easy_init(void)
{
- return calloc(1,sizeof(CURL));
+ CURL *handle;
+
+ handle=calloc(1,sizeof(CURL));
+ if(handle)
+ handle->stderr=stderr;
+
+ return handle;
}
void
@@ -133,6 +139,12 @@ curl_easy_setopt(CURL *curl,CURLoption option,...)
case CURLOPT_FAILONERROR:
curl->flags.failonerror=va_arg(ap,unsigned int);
break;
+ case CURLOPT_VERBOSE:
+ curl->flags.verbose=va_arg(ap,unsigned int);
+ break;
+ case CURLOPT_STDERR:
+ curl->stderr=va_arg(ap,FILE *);
+ break;
default:
/* We ignore the huge majority of curl options */
break;
@@ -162,6 +174,9 @@ curl_easy_perform(CURL *curl)
else
proxy=getenv(HTTP_PROXY_ENV);
+ if(curl->flags.verbose)
+ fprintf(curl->stderr,"* HTTP proxy is \"%s\"\n",proxy?proxy:"null");
+
if(curl->flags.post)
{
rc=http_open(&curl->hd,HTTP_REQ_POST,curl->url,curl->auth,0,proxy);