aboutsummaryrefslogtreecommitdiff
path: root/ponymap.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-20 01:59:41 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-20 01:59:41 +0200
commit01c2bfa5a476a5dbeb74d30c79bf8db62b6be417 (patch)
tree86cdbec9ce08d6b32abb8f9a6480c59f5b6d90f7 /ponymap.c
parent97bcad8a03de3c40456f07d613c378bc9a07570a (diff)
downloadponymap-01c2bfa5a476a5dbeb74d30c79bf8db62b6be417.tar.gz
ponymap-01c2bfa5a476a5dbeb74d30c79bf8db62b6be417.tar.xz
ponymap-01c2bfa5a476a5dbeb74d30c79bf8db62b6be417.zip
Fix timers
Fucking hell. We're still having some event scheduling issues.
Diffstat (limited to 'ponymap.c')
-rw-r--r--ponymap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ponymap.c b/ponymap.c
index d0b71ee..e4c8a98 100644
--- a/ponymap.c
+++ b/ponymap.c
@@ -315,8 +315,8 @@ static bool generator_step (struct app_context *ctx);
struct app_context
{
struct str_map config; ///< User configuration
- unsigned connect_timeout; ///< Hard timeout for connect()
- unsigned scan_timeout; ///< Hard timeout for service scans
+ unsigned connect_timeout; ///< Timeout for connect() in sec.
+ unsigned scan_timeout; ///< Timeout for service scans in sec.
json_t *json_results; ///< The results as a JSON value
const char *json_filename; ///< The filename to write JSON to
@@ -604,7 +604,7 @@ end:
static void
unit_start_scan (struct unit *u)
{
- poller_timer_set (&u->timeout_event, u->target->ctx->scan_timeout);
+ poller_timer_set (&u->timeout_event, u->target->ctx->scan_timeout * 1000);
u->fd_event.dispatcher = (poller_fd_fn) on_unit_ready;
unit_update_poller (u, NULL);
}
@@ -717,7 +717,7 @@ unit_make (struct target *target, uint32_t ip, uint16_t port,
unit_start_scan (u);
else
{
- poller_timer_set (&u->timeout_event, ctx->connect_timeout);
+ poller_timer_set (&u->timeout_event, ctx->connect_timeout * 1000);
poller_fd_set (&u->fd_event, POLLOUT);
}