Commit edee9a8a authored by Bob Halley's avatar Bob Halley
Browse files

If we discover a server is broken for a zone, don't talk to it for 10

minutes.
parent 37300957
...@@ -867,10 +867,6 @@ fctx_nextaddress(fetchctx_t *fctx) { ...@@ -867,10 +867,6 @@ fctx_nextaddress(fetchctx_t *fctx) {
fctx->find = find; fctx->find = find;
/* XXX */
if (addrinfo != NULL)
printf("RTT = %u\n", addrinfo->srtt);
return (addrinfo); return (addrinfo);
} }
...@@ -2365,6 +2361,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) { ...@@ -2365,6 +2361,7 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
dns_fixedname_t foundname; dns_fixedname_t foundname;
isc_stdtime_t now; isc_stdtime_t now;
isc_time_t tnow, *finish; isc_time_t tnow, *finish;
dns_adbaddrinfo_t *addrinfo;
REQUIRE(VALID_QUERY(query)); REQUIRE(VALID_QUERY(query));
fctx = query->fctx; fctx = query->fctx;
...@@ -2539,6 +2536,12 @@ resquery_response(isc_task_t *task, isc_event_t *event) { ...@@ -2539,6 +2536,12 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
} }
done: done:
/*
* Remember the query's addrinfo, in case we need to mark the
* server as broken.
*/
addrinfo = query->addrinfo;
/* /*
* Cancel the query. * Cancel the query.
*/ */
...@@ -2548,25 +2551,21 @@ resquery_response(isc_task_t *task, isc_event_t *event) { ...@@ -2548,25 +2551,21 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
if (result == DNS_R_FORMERR) if (result == DNS_R_FORMERR)
broken_server = ISC_TRUE; broken_server = ISC_TRUE;
if (broken_server) { if (broken_server) {
#ifdef notyet /*
result = dns_adb_marklame(dns_adb_t *adb, * XXXRTH Replace "600" with a configurable
dns_adbaddrinfo_t *addr, * value.
dns_name_t *zone, */
isc_stdtime_t expire_time); result = dns_adb_marklame(fctx->res->view->adb,
#else addrinfo,
&fctx->domain,
now + 600);
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
#endif
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
fctx_done(fctx, result); fctx_done(fctx, result);
return; return;
} }
} }
/*
* XXXRTH If we have a broken server at this point, we will
* decrease its 'goodness', possibly add a 'lame'
* entry, and maybe log a message.
*/
if (get_nameservers) { if (get_nameservers) {
dns_fixedname_init(&foundname); dns_fixedname_init(&foundname);
fname = dns_fixedname_name(&foundname); fname = dns_fixedname_name(&foundname);
......
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