pike.git/
lib/
modules/
Protocols.pmod/
DNS.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
1998-02-27
1998-02-27 08:32:20 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
9f6f4ddd073c601367af8daba50bdffd57b3bd19 (
24
lines) (+
23
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
now works with windows NT
Rev: lib/modules/Protocols.pmod/DNS.pmod:1.11
223:
static private string match_etc_hosts(string host) { if (!etc_hosts) {
-
string raw =
Stdio.read_file
("/etc/hosts");
+
string raw
;
+
#ifdef
__NT__
+
raw
=
RegGetValue(HKEY
_
LOCAL_MACHINE,
+
"
SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
+
"DataBasePath");
+
raw+="\\hosts";
+
#else
+
raw="
/etc/hosts"
;
+
#endif
+
raw = Stdio.read_file(raw
);
etc_hosts = ([ "localhost":"127.0.0.1" ]);
257:
if(!server) { string domain;
+
#if __NT__
+
domain=RegGetValue(HKEY_LOCAL_MACHINE,
+
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
+
"Domain");
+
nameservers = ({ RegGetValue(HKEY_LOCAL_MACHINE,
+
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
+
"NameServer") });
+
domains=RegGetValue(HKEY_LOCAL_MACHINE,
+
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
+
"SearchList") / " "- ({""});
+
#else
string resolv_conf = Stdio.read_file("/etc/resolv.conf"); if (!resolv_conf) {
301:
break; } }
+
#endif
if (!sizeof(nameservers)) { nameservers = ({ "127.0.0.1" }); }