PROGS = add lookup gpgwww onak splitkeys onak-mail.pl
CORE_OBJS = armor.o charfuncs.o decodekey.o getcgi.o hash.o keydb_$(DBTYPE).o \
keyid.o keyindex.o ll.o mem.o onak-conf.o parsekey.o sha1.o md5.o \
- log.o photoid.o wordlist.o
+ log.o photoid.o wordlist.o cleanup.o
OBJS = merge.o stats.o sendsync.o cleankey.o $(CORE_OBJS)
SRCS = armor.c parsekey.c merge.c keyid.c md5.c sha1.c main.c getcgi.c mem.c \
keyindex.c stats.c lookup.c add.c keydb_$(DBTYPE).c ll.c hash.c \
gpgwww.c onak-conf.c charfuncs.c sendsync.c log.c photoid.c \
- wordlist.c cleankey.c
+ wordlist.c cleankey.c cleanup.c
all: .depend $(PROGS) testparse maxpath sixdegrees splitkeys
#include "armor.h"
#include "cleankey.h"
+#include "cleanup.h"
#include "charfuncs.h"
#include "getcgi.h"
#include "keydb.h"
end_html();
fclose(stdout);
fclose(stderr);
+ catchsignals();
initdb(false);
count = cleankeys(keys);
count);
count = update_keys(&keys);
- printf("Got %d new keys.\n", count);
logthing(LOGTHING_NOTICE, "Got %d new keys.",
count);
if (keys != NULL) {
#include "armor.h"
#include "charfuncs.h"
+#include "cleanup.h"
#include "getcgi.h"
#include "hash.h"
#include "keydb.h"
return 1;
}
- while (pathlen < count) {
+ while ((!cleanup()) && (pathlen < count)) {
/*
* Fill the tree info up.
*/
readconfig(NULL);
initlogthing("gpgwww", config.logfile);
+ catchsignals();
initdb(true);
inithash();
logthing(LOGTHING_NOTICE, "Looking for path from 0x%llX to 0x%llX.",
#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
+#include "cleanup.h"
#include "getcgi.h"
#include "keydb.h"
#include "keyindex.h"
} else {
readconfig(NULL);
initlogthing("lookup", config.logfile);
+ catchsignals();
initdb(true);
switch (op) {
case OP_GET:
#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
+#include "cleanup.h"
#include "keydb.h"
#include "keyid.h"
#include "keyindex.h"
readconfig(configfile);
initlogthing("onak", config.logfile);
+ catchsignals();
if ((argc - optind) < 1) {
usage();
#include <stdio.h>
#include <stdlib.h>
+#include "cleanup.h"
#include "getcgi.h"
#include "hash.h"
#include "keydb.h"
keys = lladd(NULL, want);
oldkeys = keys;
- while (keys != NULL && have->colour == 0) {
+ while ((!cleanup()) && keys != NULL && have->colour == 0) {
sigs = cached_getkeysigs(((struct stats_key *)
keys->object)->keyid);
- while (sigs != NULL && have->colour == 0) {
+ while ((!cleanup()) && sigs != NULL && have->colour == 0) {
/*
* Check if we've seen this key before and if not mark
* it and add its sigs to the list we want to look at.
pathnum = 0;
- while (pathnum < count) {
+ while ((!cleanup()) && (pathnum < count)) {
/*
* Fill the tree info up.
*/