summaryrefslogtreecommitdiff
path: root/src/exhaustive
diff options
context:
space:
mode:
authorJ08nY2017-10-04 19:11:14 +0200
committerJ08nY2017-10-04 19:11:14 +0200
commit531c26c732ca8d01cd95c88c70bed6038bc8cba8 (patch)
tree82cdab0616f0b3faa1436dc0b08f9d3cefdf36f4 /src/exhaustive
parent53bdab0a3d0411bbdc092dc9c3ae5a0f8afa6c6d (diff)
parent5fce9d7a2b6d012fbbbf1d5fd0c4759418c3d189 (diff)
downloadecgen-531c26c732ca8d01cd95c88c70bed6038bc8cba8.tar.gz
ecgen-531c26c732ca8d01cd95c88c70bed6038bc8cba8.tar.zst
ecgen-531c26c732ca8d01cd95c88c70bed6038bc8cba8.zip
Merge branch 'feature/alarm-timeout'
Diffstat (limited to 'src/exhaustive')
-rw-r--r--src/exhaustive/exhaustive.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/exhaustive/exhaustive.c b/src/exhaustive/exhaustive.c
index 5011490..b55bcca 100644
--- a/src/exhaustive/exhaustive.c
+++ b/src/exhaustive/exhaustive.c
@@ -15,6 +15,7 @@
#include "gen/seed.h"
#include "io/output.h"
#include "util/memory.h"
+#include "util/timeout.h"
exhaustive_t *exhaustive_new(void) { return try_calloc(sizeof(exhaustive_t)); }
@@ -230,7 +231,15 @@ int exhaustive_gen_retry(curve_t *curve, const config_t *cfg,
arg_t *arg = argss ? argss[state] : NULL;
- int diff = generators[state](curve, cfg, arg, (offset_e)state);
+ int diff;
+ timeout_start(cfg->timeout) {
+ // This is not the best, but currently the best idea I have.
+ diff = start_offset - state;
+ }
+ else {
+ diff = generators[state](curve, cfg, arg, (offset_e)state);
+ }
+ timeout_stop();
int new_state = state + diff;
if (new_state < start_offset) new_state = start_offset;