1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* gpgkeys_mailto.in, gpgkeys_test.in: Use @VERSION@ so version string

stays up to date.

* gpgkeys_http.c: Don't need to define HTTP_PROXY_ENV here since it's
in ksutil.h.

* gpgkeys_curl.c (get_key, main), gpgkeys_hkp.c (main): Pass AUTH
values to curl or curl-shim.

* curl-shim.c (curl_easy_perform), gpgkeys_curl.c (main),
gpgkeys_hkp.c (main): Use curl-style proxy semantics.
This commit is contained in:
David Shaw 2005-06-23 23:42:35 +00:00
parent d65763eccd
commit ccab129be5
7 changed files with 68 additions and 39 deletions

View file

@ -29,6 +29,7 @@
#include <errno.h>
#include "http.h"
#include "util.h"
#include "ksutil.h"
#include "curl-shim.h"
static CURLcode
@ -142,10 +143,24 @@ curl_easy_perform(CURL *curl)
int rc;
CURLcode err=CURLE_OK;
const char *errstr=NULL;
char *proxy=NULL;
/* Emulate the libcurl proxy behavior. If the calling program set a
proxy, use it. If it didn't set a proxy or set it to NULL, check
for one in the environment. If the calling program explicitly
set a null-string proxy, don't set a proxy at all. */
if(curl->proxy)
{
if(*curl->proxy)
proxy=curl->proxy;
}
else
proxy=getenv(HTTP_PROXY_ENV);
if(curl->flags.post)
{
rc=http_open(&curl->hd,HTTP_REQ_POST,curl->url,curl->auth,0,curl->proxy);
rc=http_open(&curl->hd,HTTP_REQ_POST,curl->url,curl->auth,0,proxy);
if(rc==0)
{
char content_len[50];
@ -166,7 +181,7 @@ curl_easy_perform(CURL *curl)
}
else
{
rc=http_open(&curl->hd,HTTP_REQ_GET,curl->url,curl->auth,0,curl->proxy);
rc=http_open(&curl->hd,HTTP_REQ_GET,curl->url,curl->auth,0,proxy);
if(rc==0)
{
rc=http_wait_response(&curl->hd,&curl->status);