diff --git a/doc/man/kdig.1in b/doc/man/kdig.1in index a6bd0e9cef7ce85f86fedac4afc4734c279575a4..defe70eb657e9bde594b0b66dc454e889c0cef87 100644 --- a/doc/man/kdig.1in +++ b/doc/man/kdig.1in @@ -315,8 +315,8 @@ Use EDNS version (default is 0). .TP \fB+\fP[\fBno\fP]\fBtimeout\fP=\fIT\fP Set the wait\-for\-reply interval in seconds (default is 5 seconds). This timeout -applies to each query attempt. An attempt to set T to less than 1 will result -in a query timeout of 1 second being applied. +applies to each query attempt. Zero value or \fInotimeout\fP is intepreted as +infinity. .TP \fB+\fP[\fBno\fP]\fBretry\fP=\fIN\fP Set the number (>=0) of UDP retries (default is 2). This doesn\(aqt apply to diff --git a/doc/man_kdig.rst b/doc/man_kdig.rst index d84572ca43a342a580de26d45388c193c6c4af0f..a3aa4d0e5366931a3907344157233293a011b5ff 100644 --- a/doc/man_kdig.rst +++ b/doc/man_kdig.rst @@ -294,8 +294,8 @@ Options **+**\ [\ **no**\ ]\ **timeout**\ =\ *T* Set the wait-for-reply interval in seconds (default is 5 seconds). This timeout - applies to each query attempt. An attempt to set T to less than 1 will result - in a query timeout of 1 second being applied. + applies to each query attempt. Zero value or *notimeout* is intepreted as + infinity. **+**\ [\ **no**\ ]\ **retry**\ =\ *N* Set the number (>=0) of UDP retries (default is 2). This doesn't apply to diff --git a/src/utils/common/params.c b/src/utils/common/params.c index 684a7d11db0414f2f7ff1a2f10b8bd3cdb1592a5..6f8396f8dc3b7b28b70fac219c571b497dcf11bb 100644 --- a/src/utils/common/params.c +++ b/src/utils/common/params.c @@ -333,11 +333,7 @@ int params_parse_wait(const char *value, int32_t *dst) return ret; } - // Check for minimal value. - if (num < 1) { - num = 1; - // Reduce maximal value. Poll takes signed int in milliseconds. - } else if (num > INT32_MAX / 1000) { + if (num < 1 || num > INT32_MAX / 1000) { num = INT32_MAX / 1000; } diff --git a/src/utils/kdig/kdig_params.c b/src/utils/kdig/kdig_params.c index bd3f1b46d2aba93c0afbda73bd1953361bac0bdc..0528bde2de00d3ae001e7dcfb0596299b97072c4 100644 --- a/src/utils/kdig/kdig_params.c +++ b/src/utils/kdig/kdig_params.c @@ -1219,7 +1219,7 @@ static int opt_notimeout(const char *arg, void *query) { query_t *q = query; - q->wait = DEFAULT_TIMEOUT_DIG; + (void)params_parse_wait("0", &q->wait); return KNOT_EOK; }