- parse_keys(packets, &keys);
- curkey = keys;
- initdb();
- while (curkey != NULL) {
- if (store_key(curkey)) {
-// puts("Key added successfully.");
- } else {
- printf("Problem adding key '%s'.\n", strerror(errno));
- }
- curkey = curkey->next;
+ printf("Storing %d keys.\n",
+ parse_keys(packets, &keys));
+ end_html();
+ fclose(stdout);
+ fclose(stderr);
+ initdb(false);
+ count = update_keys(&keys);
+ printf("Got %d new keys.\n", count);
+ logthing(LOGTHING_NOTICE, "Got %d new keys.",
+ count);
+ if (keys != NULL) {
+ sendkeysync(keys);
+ free_publickey(keys);
+ keys = NULL;