aboutsummaryrefslogtreecommitdiff
path: root/eperd/eooqd.c
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2015-05-15 10:25:07 +0200
committerBjørn Mork <bjorn@mork.no>2015-05-15 10:25:07 +0200
commit35294332b2e75151b4b614719ee6522e1afd8748 (patch)
treefde51b865f9a08ebd3ef87bc382dec5bb165f4c9 /eperd/eooqd.c
parent02013228914a1d17e8df15d4e2b7950469395a5c (diff)
ripe-atlas-fw: imported version 45504550
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'eperd/eooqd.c')
-rw-r--r--eperd/eooqd.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/eperd/eooqd.c b/eperd/eooqd.c
index 298e63c..49371ad 100644
--- a/eperd/eooqd.c
+++ b/eperd/eooqd.c
@@ -28,6 +28,7 @@
struct slot
{
void *cmdstate;
+ struct builtin *bp;
};
static struct
@@ -51,6 +52,7 @@ static struct builtin
{ "evhttpget", &httpget_ops },
{ "evping", &ping_ops },
{ "evtdig", &tdig_ops },
+ { "evsslgetcert", &sslgetcert_ops },
{ "evtraceroute", &traceroute_ops },
{ NULL, NULL }
};
@@ -123,11 +125,6 @@ int eooqd_main(int argc, char *argv[])
DnsBase= evdns_base_new(EventBase, 1 /*initialize*/);
if (!DnsBase)
{
- crondlog(DIE9 "evdns_base_new failed"); /* exits */
- }
-
- DnsBase = evdns_base_new(EventBase, 1);
- if(!DnsBase) {
event_base_free(EventBase);
crondlog(DIE9 "evdns_base_new failed"); /* exits */
}
@@ -369,6 +366,7 @@ static void add_line(void)
if (cmdstate != NULL)
{
state->slots[slot].cmdstate= cmdstate;
+ state->slots[slot].bp= bp;
state->curr_index= slot;
state->curr_busy++;
@@ -421,7 +419,7 @@ error:
static void cmddone(void *cmdstate)
{
- int i;
+ int i, r;
char from_filename[80];
char to_filename[80];
struct stat sb;
@@ -439,8 +437,14 @@ static void cmddone(void *cmdstate)
report("cmddone: state state %p", cmdstate);
return;
}
- state->slots[i].cmdstate= NULL;
- state->curr_busy--;
+ r= state->slots[i].bp->testops->delete(cmdstate);
+ if (r != 0)
+ {
+ state->slots[i].cmdstate= NULL;
+ state->curr_busy--;
+ }
+ else
+ report("cmddone: strange, cmd %p is busy", cmdstate);
snprintf(from_filename, sizeof(from_filename),
"/home/atlas/data/new/ooq.%d", i);