mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
* ksutil.c (curl_err_to_gpg_err): Add CURLE_OK and CURLE_COULDNT_CONNECT.
* gpgkeys_curl.c (get_key): Give key-not-found error if no data is found (or file itself is not found) during a fetch.
This commit is contained in:
parent
990097b067
commit
c826ccdec1
@ -1,3 +1,11 @@
|
||||
2005-12-07 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* ksutil.c (curl_err_to_gpg_err): Add CURLE_OK and
|
||||
CURLE_COULDNT_CONNECT.
|
||||
|
||||
* gpgkeys_curl.c (get_key): Give key-not-found error if no data is
|
||||
found (or file itself is not found) during a fetch.
|
||||
|
||||
2005-12-06 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* curl-shim.c (curl_easy_perform): Fix build warning (code before
|
||||
|
@ -50,6 +50,7 @@ get_key(char *getkey)
|
||||
char errorbuffer[CURL_ERROR_SIZE];
|
||||
char request[MAX_URL];
|
||||
struct curl_writer_ctx ctx;
|
||||
int ret=KEYSERVER_OK;
|
||||
|
||||
memset(&ctx,0,sizeof(ctx));
|
||||
|
||||
@ -70,14 +71,21 @@ get_key(char *getkey)
|
||||
res=curl_easy_perform(curl);
|
||||
if(res!=CURLE_OK)
|
||||
{
|
||||
fprintf(console,"gpgkeys: %s fetch error %d: %s\n",opt->scheme,
|
||||
res,errorbuffer);
|
||||
fprintf(output,"\nKEY 0x%s FAILED %d\n",getkey,curl_err_to_gpg_err(res));
|
||||
fprintf(console,"gpgkeys: unable to fetch %s: %s\n",request,errorbuffer);
|
||||
ret=curl_err_to_gpg_err(res);
|
||||
}
|
||||
else if(!ctx.done)
|
||||
{
|
||||
fprintf(console,"gpgkeys: no key data found for %s\n",request);
|
||||
ret=KEYSERVER_KEY_NOT_FOUND;
|
||||
}
|
||||
|
||||
if(ret)
|
||||
fprintf(output,"\nKEY 0x%s FAILED %d\n",getkey,ret);
|
||||
else
|
||||
fprintf(output,"\nKEY 0x%s END\n",getkey);
|
||||
|
||||
return curl_err_to_gpg_err(res);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -46,6 +46,7 @@ int register_timeout(void) {return 0;}
|
||||
static void
|
||||
catch_alarm(int foo)
|
||||
{
|
||||
(void)foo;
|
||||
_exit(KEYSERVER_TIMEOUT);
|
||||
}
|
||||
|
||||
@ -362,8 +363,10 @@ curl_err_to_gpg_err(CURLcode error)
|
||||
{
|
||||
switch(error)
|
||||
{
|
||||
case CURLE_FTP_COULDNT_RETR_FILE: return KEYSERVER_KEY_NOT_FOUND;
|
||||
case CURLE_OK: return KEYSERVER_OK;
|
||||
case CURLE_UNSUPPORTED_PROTOCOL: return KEYSERVER_SCHEME_NOT_FOUND;
|
||||
case CURLE_COULDNT_CONNECT: return KEYSERVER_UNREACHABLE;
|
||||
case CURLE_FTP_COULDNT_RETR_FILE: return KEYSERVER_KEY_NOT_FOUND;
|
||||
default: return KEYSERVER_INTERNAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user