[svn] GnuPG - r4011 - trunk/keyserver
svn author dshaw
cvs at cvs.gnupg.org
Tue Feb 21 17:16:10 CET 2006
Author: dshaw
Date: 2006-02-21 17:16:09 +0100 (Tue, 21 Feb 2006)
New Revision: 4011
Modified:
trunk/keyserver/ChangeLog
trunk/keyserver/curl-shim.c
trunk/keyserver/curl-shim.h
Log:
* curl-shim.h, curl-shim.c (curl_easy_init, curl_easy_setopt,
curl_easy_perform): Add CURLOPT_VERBOSE and CURLOPT_STDERR for easier
debugging.
Modified: trunk/keyserver/ChangeLog
===================================================================
--- trunk/keyserver/ChangeLog 2006-02-21 16:09:09 UTC (rev 4010)
+++ trunk/keyserver/ChangeLog 2006-02-21 16:16:09 UTC (rev 4011)
@@ -1,3 +1,9 @@
+2006-02-21 David Shaw <dshaw at jabberwocky.com>
+
+ * curl-shim.h, curl-shim.c (curl_easy_init, curl_easy_setopt,
+ curl_easy_perform): Add CURLOPT_VERBOSE and CURLOPT_STDERR for
+ easier debugging.
+
2006-01-16 David Shaw <dshaw at jabberwocky.com>
* gpgkeys_hkp.c (send_key): Do not escape the '=' in the HTTP POST
Modified: trunk/keyserver/curl-shim.c
===================================================================
--- trunk/keyserver/curl-shim.c 2006-02-21 16:09:09 UTC (rev 4010)
+++ trunk/keyserver/curl-shim.c 2006-02-21 16:16:09 UTC (rev 4011)
@@ -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 *
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 @@
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 @@
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);
Modified: trunk/keyserver/curl-shim.h
===================================================================
--- trunk/keyserver/curl-shim.h 2006-02-21 16:09:09 UTC (rev 4010)
+++ trunk/keyserver/curl-shim.h 2006-02-21 16:16:09 UTC (rev 4011)
@@ -1,5 +1,5 @@
/* curl-shim.h
- * Copyright (C) 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2006 Free Software Foundation, Inc.
*
* This file is part of GNUPG.
*
@@ -66,10 +66,12 @@
void *file;
char *postfields;
unsigned int status;
+ FILE *stderr;
struct
{
unsigned int post:1;
unsigned int failonerror:1;
+ unsigned int verbose:1;
} flags;
struct http_context hd;
} CURL;
More information about the Gnupg-commits
mailing list