diff --git a/src/progress.c b/src/progress.c index 553ec1ba..d8b57e36 100644 --- a/src/progress.c +++ b/src/progress.c @@ -499,6 +499,7 @@ dot_finish (void *progress, double dltime) static void dot_set_params (const char *params) { + current_impl->interactive = false; if (!params || !*params) params = opt.dot_style; @@ -1365,6 +1366,13 @@ display_image (char *buf) static void bar_set_params (const char *params) { +/* if run_with_timeout() will be used for read, needs to disable interactive bar, + or on every timeout(1s) we will have 'retry' with error "decryption failed" */ +#if (defined(HAVE_LIBSSL) || defined(HAVE_LIBSSL32)) && defined(OPENSSL_RUN_WITHTIMEOUT) + current_impl->interactive = false; +#else + current_impl->interactive = true; +#endif if (params) { for (const char *param = params; *param; ) diff --git a/src/retr.c b/src/retr.c index 3fa83bcb..32b29868 100644 --- a/src/retr.c +++ b/src/retr.c @@ -425,7 +425,8 @@ fd_read_body (const char *downloaded_filename, int fd, FILE *out, wgint toread, { /* Don't let total idle time exceed read timeout. */ tmout = opt.read_timeout - waittm; - if (tmout < 0) + /* if 0 fd_read can be 'blocked read' */ + if (tmout <= 0) { /* We've already exceeded the timeout. */ ret = -1, errno = ETIMEDOUT;