Date: Thu, 27 Feb 2003 18:25:31 +0900 (JST) From: YAMAMOTO Shigeru <shigeru@iij.ad.jp> To: current@FreeBSD.ORG Subject: small patch for controlling resolver information cache Message-ID: <20030227.182531.108817955.shigeru@iij.ad.jp>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi all,
I make a small patch for mobile users.
This patch is controlling cache of resolver information.
If seting 'RES_NOCACHE' to 'yes', any application reads /etc/resolv.conf at
any DNS quering.
I think, it is useful for using heavey network applications, such as
mozilla, in mobile environment.
Please try it if you want.
Thanks,
-------
YAMAMOTO Shigeru <shigeru@iij.ad.jp>
[-- Attachment #2 --]
cvs diff: Diffing .
Index: res_init.c
===================================================================
RCS file: /share/cvsup/FreeBSD/current/usr/src/lib/libc/net/res_init.c,v
retrieving revision 1.30
diff -u -r1.30 res_init.c
--- res_init.c 25 Sep 2002 04:06:35 -0000 1.30
+++ res_init.c 25 Feb 2003 06:34:52 -0000
@@ -493,7 +493,12 @@
_res.options |= RES_NOALIASES;
else if ((cp = getenv("RES_OPTIONS")) != NULL)
res_setoptions(cp, "env");
- _res.options |= RES_INIT;
+ if (getenv("RES_NOCACHE") != NULL) {
+ _res.options &= ~(RES_INIT);
+ }
+ else {
+ _res.options |= RES_INIT;
+ }
return (0);
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030227.182531.108817955.shigeru>
