]> gitweb.factorcode.org Git - factor.git/commitdiff
io.servers: don't try to open SSL sockets if they're not supported on the current...
authorSlava Pestov <slava@factorcode.org>
Sun, 14 Nov 2010 00:31:29 +0000 (18:31 -0600)
committerSlava Pestov <slava@factorcode.org>
Sun, 14 Nov 2010 00:32:10 +0000 (18:32 -0600)
basis/io/servers/servers.factor [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 0ef4616..5eee753
@@ -86,7 +86,9 @@ M: f >insecure ;
     [ dup secure? [ <secure> ] unless ] map ;
 
 : listen-on ( threaded-server -- addrspecs )
-    [ secure>> >secure ] [ insecure>> >insecure ] bi append
+    [ secure>> ssl-supported? [ >secure ] [ drop { } ] if ]
+    [ insecure>> >insecure ]
+    bi append
     [ resolve-host ] map concat ;
 
 : accepted-connection ( remote local -- )
@@ -141,7 +143,7 @@ M: threaded-server handle-client* handler>> call( -- ) ;
 \ start-accept-loop NOTICE add-error-logging
 
 : create-secure-context ( threaded-server -- threaded-server )
-    dup secure>> [
+    dup secure>> ssl-supported? and [
         dup secure-config>> <secure-context> >>secure-context
     ] when ;