Special-case "localhost" in dns queries

db4
Doug Coleman 2010-10-03 03:49:10 -05:00
parent 32f447d796
commit 24abb667fe
1 changed files with 10 additions and 2 deletions

View File

@ -8,7 +8,7 @@ io.files io.ports io.sockets io.sockets.private
io.streams.byte-array io.timeouts kernel make math math.bitwise
math.parser math.ranges math.statistics memoize namespaces
nested-comments random sequences slots.syntax splitting strings
system unicode.categories vectors vocabs.loader ;
system unicode.categories vectors vocabs.loader unicode.case ;
IN: dns
GENERIC: stream-peek1 ( stream -- byte/f )
@ -400,7 +400,15 @@ M: SOA rdata>byte-array
[ dns-AAAA-query a-message. ]
[ dns-MX-query mx-message. ] tri ;
! M: string resolve-host dns-A-query message>a-names [ <ipv4> ] map ;
USE: nested-comments
(*
M: string resolve-host
dup >lower "localhost" = [
drop resolve-localhost
] [
dns-A-query message>a-names [ <ipv4> ] map
] if ;
*)
HOOK: initial-dns-servers os ( -- seq )