/* lookup in infra cache */
entry_ttl = infra_get_host_rto(worker->env.infra_cache,
&a->addr, a->addrlen, &ri, &delay, *worker->env.now);
- if(entry_ttl == -1) {
+ if(entry_ttl == -2 && ri.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
+ if(!ssl_printf(ssl, "expired, rto %d msec.\n", ri.rto))
+ return;
+ continue;
+ }
+ if(entry_ttl == -1 || entry_ttl == -2) {
if(!ssl_printf(ssl, "not in infra cache.\n"))
return;
continue; /* skip stuff not in infra cache */
a->ipstr = ip_str;
/* skip expired stuff (only backed off) */
if(d->ttl < a->now) {
+ if(d->rtt.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
+ if(!ssl_printf(a->ssl, "%s expired rto %d\n", ip_str,
+ d->rtt.rto)) return;
+ }
if(d->lameness)
lruhash_traverse(d->lameness, 0, &dump_infra_lame, arg);
return;
struct lruhash_entry* e = infra_lookup_host_nottl(infra, addr,
addrlen, 0);
struct infra_host_data* data;
- int ttl = -1;
+ int ttl = -2;
if(!e) return -1;
data = (struct infra_host_data*)e->data;
if(data->ttl >= timenow) {
if(timenow > host->ttl) {
/* expired entry */
/* see if this can be a re-probe of an unresponsive server */
+ /* minus 1000 because that is outside of the RTTBAND, so
+ * blacklisted servers stay blacklisted if this is chosen */
if(host->rtt.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
*rtt = USEFUL_SERVER_TOP_TIMEOUT-1000;
lock_rw_unlock(&e->lock);
* @param delay: probe delay (if any).
* @param timenow: what time it is now.
* @return TTL the infra host element is valid for. If -1: not found in cache.
+ * TTL -2: found but expired.
*/
int infra_get_host_rto(struct infra_cache* infra,
struct sockaddr_storage* addr, socklen_t addrlen,