From: wessels <> Date: Sun, 18 Apr 1999 11:44:55 +0000 (+0000) Subject: give up retransmitting after (20) tries X-Git-Tag: SQUID_3_0_PRE1~2273 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2dc42425422dac83b025d550815c53baac00d1f;p=thirdparty%2Fsquid.git give up retransmitting after (20) tries --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 5ca70f9c34..58ce57fe17 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.5 1999/04/18 05:30:56 wessels Exp $ + * $Id: dns_internal.cc,v 1.6 1999/04/18 05:44:55 wessels Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -42,6 +42,8 @@ #define DOMAIN_PORT 53 #endif +#define IDNS_MAX_TRIES 20 + typedef struct _ns ns; struct _ns { struct sockaddr_in S; @@ -297,7 +299,17 @@ idnsCheckQueue(void *unused) debug(78, 1) ("idnsCheckQueue: ID %#04x timeout\n", q->id); dlinkDelete(&q->lru, &lru_list); - idnsSendQuery(q); + if (q->nsends < IDNS_MAX_TRIES) { + idnsSendQuery(q); + } else { + int v = cbdataValid(q->callback_data); + debug(78, 1) ("idnsCheckQueue: ID %x: giving up after %d tries\n", + q->nsends); + cbdataUnlock(q->callback_data); + if (v) + q->callback(q->callback_data, NULL, 0); + memFree(q, MEM_IDNS_QUERY); + } } }