io.servers: don't try to open SSL sockets if they're not supported on the current platform (ie, Windows)

db4
Slava Pestov 2010-11-13 18:31:29 -06:00
parent 0c840a7965
commit c4a83d2d0b
1 changed files with 4 additions and 2 deletions

6
basis/io/servers/servers.factor Normal file → Executable file
View File

@ -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 ;