[svn] GnuPG - r3955 - trunk/keyserver
svn author dshaw
cvs at cvs.gnupg.org
Wed Dec 7 23:25:59 CET 2005
Author: dshaw
Date: 2005-12-07 23:25:58 +0100 (Wed, 07 Dec 2005)
New Revision: 3955
Modified:
trunk/keyserver/ChangeLog
trunk/keyserver/gpgkeys_curl.c
trunk/keyserver/ksutil.c
Log:
* 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.
Modified: trunk/keyserver/ChangeLog
===================================================================
--- trunk/keyserver/ChangeLog 2005-12-06 21:10:34 UTC (rev 3954)
+++ trunk/keyserver/ChangeLog 2005-12-07 22:25:58 UTC (rev 3955)
@@ -1,3 +1,11 @@
+2005-12-07 David Shaw <dshaw at 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 at jabberwocky.com>
* curl-shim.c (curl_easy_perform): Fix build warning (code before
Modified: trunk/keyserver/gpgkeys_curl.c
===================================================================
--- trunk/keyserver/gpgkeys_curl.c 2005-12-06 21:10:34 UTC (rev 3954)
+++ trunk/keyserver/gpgkeys_curl.c 2005-12-07 22:25:58 UTC (rev 3955)
@@ -50,6 +50,7 @@
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 @@
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
Modified: trunk/keyserver/ksutil.c
===================================================================
--- trunk/keyserver/ksutil.c 2005-12-06 21:10:34 UTC (rev 3954)
+++ trunk/keyserver/ksutil.c 2005-12-07 22:25:58 UTC (rev 3955)
@@ -46,6 +46,7 @@
static void
catch_alarm(int foo)
{
+ (void)foo;
_exit(KEYSERVER_TIMEOUT);
}
@@ -362,8 +363,10 @@
{
switch(error)
{
+ 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;
- case CURLE_UNSUPPORTED_PROTOCOL: return KEYSERVER_SCHEME_NOT_FOUND;
default: return KEYSERVER_INTERNAL_ERROR;
}
}
More information about the Gnupg-commits
mailing list