* gpgkeys_finger.c (get_key), gpgkeys_curl.c (get_key): Better language
authorDavid Shaw <dshaw@jabberwocky.com>
Wed, 7 Dec 2005 23:00:30 +0000 (23:00 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Wed, 7 Dec 2005 23:00:30 +0000 (23:00 +0000)
for the key-not-found error.

keyserver/ChangeLog
keyserver/gpgkeys_curl.c
keyserver/gpgkeys_finger.c

index 6ac71ab..f5c720c 100644 (file)
@@ -1,5 +1,8 @@
 2005-12-07  David Shaw  <dshaw@jabberwocky.com>
 
+       * gpgkeys_finger.c (get_key), gpgkeys_curl.c (get_key): Better
+       language for the key-not-found error.
+
        * ksutil.c (curl_err_to_gpg_err): Add CURLE_OK and
        CURLE_COULDNT_CONNECT.
 
index 73f8671..10e44a1 100644 (file)
@@ -50,7 +50,6 @@ 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));
 
@@ -71,21 +70,19 @@ get_key(char *getkey)
   res=curl_easy_perform(curl);
   if(res!=CURLE_OK)
     {
-      fprintf(console,"gpgkeys: unable to fetch %s: %s\n",request,errorbuffer);
-      ret=curl_err_to_gpg_err(res);
+      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));
     }
   else if(!ctx.done)
     {
       fprintf(console,"gpgkeys: no key data found for %s\n",request);
-      ret=KEYSERVER_KEY_NOT_FOUND;
+      fprintf(output,"\nKEY 0x%s FAILED %d\n",getkey,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 ret;
+  return curl_err_to_gpg_err(res);
 }
 
 static void 
index deafb7a..4124ebc 100644 (file)
@@ -339,9 +339,9 @@ get_key (char *getkey)
     fprintf (output,"KEY 0x%s END\n", getkey);
   else
     {
-      fprintf (console,"gpgkeys: key %s not found on keyserver\n",getkey);
-      fprintf (output,"KEY 0x%s FAILED %d\n",
-               getkey,KEYSERVER_KEY_NOT_FOUND);
+      fprintf(console,"gpgkeys: no key data found for finger:%s\n",
+             opt->opaque);
+      fprintf(output,"KEY 0x%s FAILED %d\n",getkey,KEYSERVER_KEY_NOT_FOUND);
     }
 
   xfree(line);