summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
diff options
context:
space:
mode:
authormurray <murray@FreeBSD.org>2003-12-07 12:32:24 +0000
committermurray <murray@FreeBSD.org>2003-12-07 12:32:24 +0000
commit93b87ff9b0c62b50781c5c64ceca2f2662fee9d2 (patch)
tree1a35bb43b7ac361b9f14caf982706023116c0b51 /lib/libc/net
parentac33b83fc2706126a74084cba417f5084ff93c1e (diff)
downloadFreeBSD-src-93b87ff9b0c62b50781c5c64ceca2f2662fee9d2.zip
FreeBSD-src-93b87ff9b0c62b50781c5c64ceca2f2662fee9d2.tar.gz
Add support for timeout: and attempts: resolver options.
Submitted by: Paul Vixie <paul@vix.com> / ISC MFC After: 1 week
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/res_init.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c
index 9bb8452..6c22973 100644
--- a/lib/libc/net/res_init.c
+++ b/lib/libc/net/res_init.c
@@ -524,6 +524,26 @@ res_setoptions(options, source)
if (_res.options & RES_DEBUG)
printf(";;\tndots=%d\n", _res.ndots);
#endif
+ } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) {
+ i = atoi(cp + sizeof("timeout:") - 1);
+ if (i <= RES_MAXRETRANS)
+ _res.retrans = i;
+ else
+ _res.retrans = RES_MAXRETRANS;
+#ifdef DEBUG
+ if (_res.options & RES_DEBUG)
+ printf(";;\ttimeout=%d\n", _res.retrans);
+#endif
+ } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
+ i = atoi(cp + sizeof("attempts:") - 1);
+ if (i <= RES_MAXRETRY)
+ _res.retry = i;
+ else
+ _res.retry = RES_MAXRETRY;
+#ifdef DEBUG
+ if (_res.options & RES_DEBUG)
+ printf(";;\tretry=%d\n", _res.retry);
+#endif
} else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
#ifdef DEBUG
if (!(_res.options & RES_DEBUG)) {
OpenPOWER on IntegriCloud