]> gitweb.factorcode.org Git - factor.git/commitdiff
Special-case "localhost" in dns queries
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 3 Oct 2010 08:49:10 +0000 (03:49 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 5 Oct 2010 14:56:29 +0000 (09:56 -0500)
extra/dns/dns.factor

index 84a9b6d50d11f75d09249c64db0eeff596164a36..0d85021cb4ef2618b5c9fe32e84bc2e6ca02c342 100644 (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 )