summaryrefslogtreecommitdiffstats
path: root/keyserver/curl-shim.c
diff options
context:
space:
mode:
authorDavid Shaw <dshaw@jabberwocky.com>2009-05-28 06:25:25 +0200
committerDavid Shaw <dshaw@jabberwocky.com>2009-05-28 06:25:25 +0200
commita7205a080cf1b17d385453c8ec244d3bf67bf537 (patch)
tree4fe96d047f829ab9b026fe9a8aa8d0c9bb0523d5 /keyserver/curl-shim.c
parent* srv.c (getsrv): Raise maximum packet size to 2048, as PACKETSZ is (diff)
downloadgnupg2-a7205a080cf1b17d385453c8ec244d3bf67bf537.tar.xz
gnupg2-a7205a080cf1b17d385453c8ec244d3bf67bf537.zip
* http.h, http.c (send_request): Pass in srvtag and make its presence
sufficient to turn the feature on. (http_open): From here. (http_document): And here. * gpgkeys_hkp.c (srv_replace): New function to transform a SRV hostname to a real hostname. (main): Call it from here for the HAVE_LIBCURL case (without libcurl is handled via the curl-shim). * curl-shim.h, curl-shim.c (curl_easy_setopt, curl_easy_perform): Add a CURLOPT_SRVTAG_GPG_HACK (passed through the the http engine).
Diffstat (limited to 'keyserver/curl-shim.c')
-rw-r--r--keyserver/curl-shim.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/keyserver/curl-shim.c b/keyserver/curl-shim.c
index 0c8bfdc9b..98b5b24c7 100644
--- a/keyserver/curl-shim.c
+++ b/keyserver/curl-shim.c
@@ -144,6 +144,9 @@ curl_easy_setopt(CURL *curl,CURLoption option,...)
case CURLOPT_POSTFIELDS:
curl->postfields=va_arg(ap,char *);
break;
+ case CURLOPT_SRVTAG_GPG_HACK:
+ curl->srvtag=va_arg(ap,char *);
+ break;
case CURLOPT_FAILONERROR:
curl->flags.failonerror=va_arg(ap,long)?1:0;
break;
@@ -193,7 +196,7 @@ curl_easy_perform(CURL *curl)
if(curl->flags.post)
{
rc = http_open (&curl->hd, HTTP_REQ_POST, curl->url, curl->auth,
- 0, proxy, NULL);
+ 0, proxy, NULL, curl->srvtag);
if (!rc)
{
unsigned int post_len = strlen(curl->postfields);
@@ -216,7 +219,7 @@ curl_easy_perform(CURL *curl)
else
{
rc = http_open (&curl->hd, HTTP_REQ_GET, curl->url, curl->auth,
- 0, proxy, NULL);
+ 0, proxy, NULL, curl->srvtag);
if (!rc)
{
rc = http_wait_response (curl->hd);