* keyserver.c (keyserver_refresh): Keep track of keys already fetched so
authorDavid Shaw <dshaw@jabberwocky.com>
Wed, 26 May 2004 15:01:48 +0000 (15:01 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Wed, 26 May 2004 15:01:48 +0000 (15:01 +0000)
we don't do a regular keyserver fetch if the preferred keyserver fetch has
exhausted the list.

g10/ChangeLog
g10/keyserver.c

index 274b514..3d1b1f4 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-26  David Shaw  <dshaw@jabberwocky.com>
+
+       * keyserver.c (keyserver_refresh): Keep track of keys already
+       fetched so we don't do a regular keyserver fetch if the preferred
+       keyserver fetch has exhausted the list.
+
 2004-05-23  David Shaw  <dshaw@jabberwocky.com>
 
        * verify.c (verify_signatures): Verify multiple files in the same
index fc3f4fe..5c0311a 100644 (file)
@@ -1487,7 +1487,7 @@ keyidlist(STRLIST users,KEYDB_SEARCH_DESC **klist,int *count,int fakev3)
 int 
 keyserver_refresh(STRLIST users)
 {
-  int rc,count,fakev3=0;
+  int rc,count,numdesc,fakev3=0;
   KEYDB_SEARCH_DESC *desc;
 
   /* We switch merge_only on during a refresh, as 'refresh' should
@@ -1502,10 +1502,11 @@ keyserver_refresh(STRLIST users)
         ascii_strcasecmp(opt.keyserver->scheme,"mailto")==0))
     fakev3=1;
 
-  rc=keyidlist(users,&desc,&count,fakev3);
+  rc=keyidlist(users,&desc,&numdesc,fakev3);
   if(rc)
     return rc;
 
+  count=numdesc;
   if(count>0)
     {
       int i;
@@ -1532,12 +1533,16 @@ keyserver_refresh(STRLIST users)
                     get it again from the regular keyserver. */
 
                  desc[i].mode=KEYDB_SEARCH_MODE_NONE;
+                 count--;
                }
 
              free_keyserver_spec(keyserver);
            }
        }
+    }
 
+  if(count>0)
+    {
       if(opt.keyserver)
        {
          if(count==1)
@@ -1547,7 +1552,7 @@ keyserver_refresh(STRLIST users)
                     count,opt.keyserver->uri);
        }
 
-      rc=keyserver_work(GET,NULL,desc,count,opt.keyserver);
+      rc=keyserver_work(GET,NULL,desc,numdesc,opt.keyserver);
     }
 
   m_free(desc);