diff options
author | David Shaw <dshaw@jabberwocky.com> | 2005-12-07 23:25:58 +0100 |
---|---|---|
committer | David Shaw <dshaw@jabberwocky.com> | 2005-12-07 23:25:58 +0100 |
commit | c826ccdec1f484266894e2e0be6ffd8c8bcce2fe (patch) | |
tree | 4736ae2da64185289c4aa4717e56b7230669943b /keyserver/gpgkeys_curl.c | |
parent | Missed file. (diff) | |
download | gnupg2-c826ccdec1f484266894e2e0be6ffd8c8bcce2fe.tar.xz gnupg2-c826ccdec1f484266894e2e0be6ffd8c8bcce2fe.zip |
* 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.
Diffstat (limited to 'keyserver/gpgkeys_curl.c')
-rw-r--r-- | keyserver/gpgkeys_curl.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/keyserver/gpgkeys_curl.c b/keyserver/gpgkeys_curl.c index c411b231f..73f8671d2 100644 --- a/keyserver/gpgkeys_curl.c +++ b/keyserver/gpgkeys_curl.c @@ -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 |