]> gitweb.factorcode.org Git - factor.git/commitdiff
urls: remove unnecessary >secure-addr indirection.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 17 Apr 2016 00:11:01 +0000 (17:11 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 17 Apr 2016 00:11:01 +0000 (17:11 -0700)
basis/urls/urls.factor

index 3e3822452262b759afe20eedb21cfca7423d72fa..5f31a0c27d613a33408af34df2203c937ef5fe46 100644 (file)
@@ -168,22 +168,16 @@ PRIVATE>
 : secure-protocol? ( protocol -- ? )
     "https" = ;
 
-<PRIVATE
-
-GENERIC# >secure-addr 1 ( addrspec host -- addrspec' )
-
-PRIVATE>
-
 : url-addr ( url -- addr )
     [
         [ host>> ]
         [ port>> ]
         [ protocol>> protocol-port ]
         tri or <inet>
-    ]
-    [ host>> ]
-    [ protocol>> ] tri
-    secure-protocol? [ >secure-addr ] [ drop ] if ;
+    ] [
+        dup protocol>> secure-protocol?
+        [ host>> <secure> ] [ drop ] if
+    ] bi ;
 
 : set-url-addr ( url addr -- url )
     [ host>> >>host ] [ port>> >>port ] bi ;
@@ -191,11 +185,6 @@ PRIVATE>
 : ensure-port ( url -- url' )
     clone dup protocol>> '[ _ protocol-port or ] change-port ;
 
-! Secure sockets
-UNION: abstract-inet inet inet4 inet6 ;
-
-M: abstract-inet >secure-addr <secure> ;
-
 ! Literal syntax
 SYNTAX: URL" lexer get skip-blank parse-string >url suffix! ;