Commit 78f6ead4 authored by Diego Fronza's avatar Diego Fronza
Browse files

Don't retry +tcp queries on failure if tries=1 or retries=0

Before this commit, a premature EOF (connection closed) on tcp queries
was causing dig to automatically attempt to send the query again, even
if +tries=1 or +retries=0 was provided on command line.

This commit fix the problem by taking into account the no. of retries
specified by the user when processing a premature EOF on tcp
parent 8bb15472
......@@ -3117,7 +3117,8 @@ force_next(dig_query_t *query) {
static void
requeue_or_update_exitcode(dig_lookup_t *lookup) {
if (lookup->eoferr == 0U) {
if (lookup->eoferr == 0U && lookup->retries > 1) {
* Peer closed the connection prematurely for the first time
* for this lookup. Try again, keeping track of this failure.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment