1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02: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:
David Shaw 2005-12-07 22:25:58 +00:00
parent 990097b067
commit c826ccdec1
3 changed files with 24 additions and 5 deletions

View file

@ -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