return -1; /* server is lame */
else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT &&
lost >= USEFUL_SERVER_MAX_LOST)
- /* server is unresponsive */
- return USEFUL_SERVER_TOP_TIMEOUT;
+ /* server is unresponsive, but keep trying slowly */
+ return USEFUL_SERVER_TOP_TIMEOUT+1;
else if(a->lame)
return rtt+USEFUL_SERVER_TOP_TIMEOUT+1; /* nonpref */
else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT) /* not blacklisted*/
if(num == 0)
return NULL;
verbose(VERB_ALGO, "selrtt %d", selrtt);
- if(selrtt > USEFUL_SERVER_TOP_TIMEOUT*2) {
- verbose(VERB_ALGO, "chase to recursion lame server");
- *chase_to_rd = 1;
- }
- if(selrtt > USEFUL_SERVER_TOP_TIMEOUT) {
- verbose(VERB_ALGO, "chase to dnssec lame server");
- *dnssec_expected = 0;
- }
- if(selrtt == USEFUL_SERVER_TOP_TIMEOUT) {
- verbose(VERB_ALGO, "chase to blacklisted lame server");
- /* the best choice is a blacklisted, unresponsive server,
- * we need to throttle down our traffic towards it */
- if(ub_random(env->rnd) % 100 != 1) {
- /* 99% of the time, drop query */
+ if(selrtt > BLACKLIST_PENALTY) {
+ if(selrtt-BLACKLIST_PENALTY > USEFUL_SERVER_TOP_TIMEOUT*2) {
+ verbose(VERB_ALGO, "chase to recursion lame server");
+ *chase_to_rd = 1;
+ }
+ } else {
+ if(selrtt > USEFUL_SERVER_TOP_TIMEOUT*2) {
+ verbose(VERB_ALGO, "chase to recursion lame server");
+ *chase_to_rd = 1;
+ }
+ if(selrtt > USEFUL_SERVER_TOP_TIMEOUT) {
+ verbose(VERB_ALGO, "chase to dnssec lame server");
+ *dnssec_expected = 0;
+ }
+ if(selrtt == USEFUL_SERVER_TOP_TIMEOUT) {
+ verbose(VERB_ALGO, "chase to blacklisted lame server");
return NULL;
}
}