BIND9 递归查询超时机制

来源:互联网 发布:淘宝上老款诺基亚来源 编辑:程序博客网 时间:2024/05/29 07:32
static inline voidfctx_setretryinterval(fetchctx_t *fctx, unsigned int rtt) {unsigned int seconds;unsigned int us;/* * We retry every .8 seconds the first two times through the address * list, and then we do exponential back-off. */if (fctx->restarts < 3)us = 800000;elseus = (800000 << (fctx->restarts - 2));/* * Double the round-trip time. */rtt *= 2;/* * Always wait for at least the doubled round-trip time. */if (us < rtt)us = rtt;/* * But don't ever wait for more than 10 seconds. */if (us > 10000000)us = 10000000;seconds = us / 1000000;us -= seconds * 1000000;isc_interval_set(&fctx->interval, seconds, us * 1000);}


 

原创粉丝点击