From: hno <> Date: Sun, 4 Apr 2004 20:31:05 +0000 (+0000) Subject: Backed out bad patch for bug #851. X-Git-Tag: SQUID_3_0_PRE4~1112 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5684ff511a1753ea8ac8cb36a579429d10ca1405;p=thirdparty%2Fsquid.git Backed out bad patch for bug #851. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index cce96f3829..fc45e3199a 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.60 2004/04/03 14:52:21 hno Exp $ + * $Id: dns_internal.cc,v 1.61 2004/04/04 14:31:05 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -75,8 +75,6 @@ struct _idns_query IDNSCB *callback; void *callback_data; int attempt; - const char *error; - int rcode; }; struct _ns @@ -575,15 +573,11 @@ idnsGrokReply(const char *buf, size_t sz) dlinkDelete(&q->lru, &lru_list); idnsRcodeCount(n, q->attempt); - q->error = NULL; if (n < 0) { debug(78, 3) ("idnsGrokReply: error %d\n", rfc1035_errno); - q->error = rfc1035_error_message; - q->rcode = -n; - - if (q->rcode == 2 && ++q->attempt < MAX_ATTEMPT) { + if (-2 == n && ++q->attempt < MAX_ATTEMPT) { /* * RCODE 2 is "Server failure - The name server was * unable to process this query due to a problem with @@ -601,7 +595,7 @@ idnsGrokReply(const char *buf, size_t sz) q->callback = NULL; if (cbdataReferenceValidDone(q->callback_data, &cbdata)) - q->callback(q->callback_data, answers, n, q->error); + callback(cbdata, answers, n); rfc1035RRDestroy(answers, n); @@ -712,7 +706,7 @@ idnsCheckQueue(void *unused) q = (idns_query *)n->data; - if (tvSubDsec(q->sent_t, current_time) < Config.Timeout.idns_retransmit * (1 << (q->nsends - 1) % nns)) + if (tvSubDsec(q->sent_t, current_time) < Config.Timeout.idns_retransmit * (1 << q->nsends % nns)) break; debug(78, 3) ("idnsCheckQueue: ID %#04x timeout\n", @@ -733,12 +727,8 @@ idnsCheckQueue(void *unused) callback = q->callback; q->callback = NULL; - if (cbdataReferenceValidDone(q->callback_data, &cbdata)) { - if (q->rcode != 0) - q->callback(q->callback_data, NULL, -q->rcode, q->error); - else - q->callback(q->callback_data, NULL, -16, "Timeout"); - } + if (cbdataReferenceValidDone(q->callback_data, &cbdata)) + callback(cbdata, NULL, 0); memFree(q, MEM_IDNS_QUERY); } @@ -856,7 +846,7 @@ idnsALookup(const char *name, IDNSCB * callback, void *data) if (0 == q->id) { /* problem with query data -- query not sent */ - callback(data, NULL, 0, "Internal error"); + callback(data, NULL, 0); memFree(q, MEM_IDNS_QUERY); return; } diff --git a/src/typedefs.h b/src/typedefs.h index 22e702ed54..40ce460481 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.172 2004/04/03 14:52:21 hno Exp $ + * $Id: typedefs.h,v 1.173 2004/04/04 14:31:05 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -316,7 +316,7 @@ typedef stateful_helper_callback_t HLPSCB(void *, void *lastserver, char *buf); typedef int HLPSAVAIL(void *); typedef void HLPSONEQ(void *); typedef void HLPCMDOPTS(int *argc, char **argv); -typedef void IDNSCB(void *, rfc1035_rr *, int, const char *); +typedef void IDNSCB(void *, rfc1035_rr *, int); typedef double hbase_f(double); typedef void StatHistBinDumper(StoreEntry *, int idx, double val, double size, int count);