- 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;
+ count = parse_keys(packets, &keys);
+ logthing(LOGTHING_NOTICE, "Received %d keys.",
+ count);
+ printf("Storing %d keys.\n", count);
+ end_html();
+ fclose(stdout);
+ fclose(stderr);
+ catchsignals();
+ initdb(false);
+
+ count = cleankeys(keys);
+ logthing(LOGTHING_INFO, "%d keys cleaned.",
+ count);
+
+ count = update_keys(&keys, true);
+ logthing(LOGTHING_NOTICE, "Got %d new keys.",
+ count);
+
+ if (keys != NULL) {
+ free_publickey(keys);
+ keys = NULL;