mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* 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.
This commit is contained in:
parent
a918d63fd5
commit
6f0ed8571b
6 changed files with 37 additions and 31 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue