From d4123333c0a6f7836df8ce40b56b9dc308da2925 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sat, 20 Oct 2018 18:53:14 +0200 Subject: [PATCH] Do stdin read timeout check only in case no data has been processed --- src/monitor.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/monitor.c b/src/monitor.c index 1cb998237..2d47b16ad 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -285,22 +285,25 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) // stdin read timeout check - if (status_ctx->stdin_read_timeout_cnt >= STDIN_TIMEOUT_MIN) + if (status_get_progress_done (hashcat_ctx) == 0) { - if (status_ctx->stdin_read_timeout_cnt >= STDIN_TIMEOUT_MAX) + if (status_ctx->stdin_read_timeout_cnt >= STDIN_TIMEOUT_MIN) { - EVENT_DATA (EVENT_MONITOR_NOINPUT_ABORT, NULL, 0); + if (status_ctx->stdin_read_timeout_cnt >= STDIN_TIMEOUT_MAX) + { + EVENT_DATA (EVENT_MONITOR_NOINPUT_ABORT, NULL, 0); - myabort (hashcat_ctx); + myabort (hashcat_ctx); - status_ctx->shutdown_inner = true; + status_ctx->shutdown_inner = true; - break; - } + break; + } - if ((status_ctx->stdin_read_timeout_cnt % STDIN_TIMEOUT_MIN) == 0) - { - EVENT_DATA (EVENT_MONITOR_NOINPUT_HINT, NULL, 0); + if ((status_ctx->stdin_read_timeout_cnt % STDIN_TIMEOUT_MIN) == 0) + { + EVENT_DATA (EVENT_MONITOR_NOINPUT_HINT, NULL, 0); + } } } }