diff options
author | David Shaw <dshaw@jabberwocky.com> | 2005-07-20 23:48:28 +0200 |
---|---|---|
committer | David Shaw <dshaw@jabberwocky.com> | 2005-07-20 23:48:28 +0200 |
commit | 6f0ed8571b1b17cc8d7bba23acb1c4a5c295205a (patch) | |
tree | 886fbcf62d6b0eb59da44eb33cd87537adf1cb0d /keyserver/gpgkeys_curl.c | |
parent | * keyserver.c (curl_can_handle): New. Do a runtime check against libcurl (diff) | |
download | gnupg2-6f0ed8571b1b17cc8d7bba23acb1c4a5c295205a.tar.xz gnupg2-6f0ed8571b1b17cc8d7bba23acb1c4a5c295205a.zip |
* gpgkeys_curl.c (get_key, main): Don't try and be smart about what
protocols we handle. Directly pass them to curl or fake-curl and see if
an error comes back.
* curl-shim.h, curl-shim.c (handle_error), ksutil.c (curl_err_to_gpg_err):
Add support for CURLE_UNSUPPORTED_PROTOCOL in fake curl.
* Makefile.am: Don't need -DFAKE_CURL any longer since it's in config.h.
Diffstat (limited to 'keyserver/gpgkeys_curl.c')
-rw-r--r-- | keyserver/gpgkeys_curl.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/keyserver/gpgkeys_curl.c b/keyserver/gpgkeys_curl.c index 73aeb09cd..c3dce6abd 100644 --- a/keyserver/gpgkeys_curl.c +++ b/keyserver/gpgkeys_curl.c @@ -68,7 +68,7 @@ get_key(char *getkey) curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,errorbuffer); res=curl_easy_perform(curl); - if(res!=0) + if(res!=CURLE_OK) { fprintf(console,"gpgkeys: %s fetch error %d: %s\n",opt->scheme, res,errorbuffer); @@ -77,7 +77,7 @@ get_key(char *getkey) else fprintf(output,"\nKEY 0x%s END\n",getkey); - return KEYSERVER_OK; + return curl_err_to_gpg_err(res); } static void @@ -226,27 +226,6 @@ main(int argc,char *argv[]) ret=KEYSERVER_SCHEME_NOT_FOUND; goto fail; } -#ifdef HTTP_VIA_LIBCURL - else if(strcasecmp(opt->scheme,"http")==0) - ; -#endif /* HTTP_VIA_LIBCURL */ -#ifdef HTTPS_VIA_LIBCURL - else if(strcasecmp(opt->scheme,"https")==0) - ; -#endif /* HTTP_VIA_LIBCURL */ -#ifdef FTP_VIA_LIBCURL - else if(strcasecmp(opt->scheme,"ftp")==0) - ; -#endif /* FTP_VIA_LIBCURL */ -#ifdef FTPS_VIA_LIBCURL - else if(strcasecmp(opt->scheme,"ftps")==0) - ; -#endif /* FTPS_VIA_LIBCURL */ - else - { - fprintf(console,"gpgkeys: scheme `%s' not supported\n",opt->scheme); - return KEYSERVER_SCHEME_NOT_FOUND; - } if(!opt->host) { |