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
connections.
*/
static void
requeue_or_update_exitcode(dig_lookup_t *lookup) {
- if (lookup->eoferr == 0U) {
+ if (lookup->eoferr == 0U && lookup->retries > 1) {
+ --lookup->retries;
/*
* Peer closed the connection prematurely for the first time
* for this lookup. Try again, keeping track of this failure.