From 47f1c31261e3fb411279aa31d2f3049f919fabcb Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 May 2008 23:36:15 -0500 Subject: [PATCH] More Unix I/O work --- extra/io/ports/ports-docs.factor | 7 ++----- extra/io/unix/sockets/secure/secure.factor | 11 ++++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/extra/io/ports/ports-docs.factor b/extra/io/ports/ports-docs.factor index e94df99a84..265b74e87a 100755 --- a/extra/io/ports/ports-docs.factor +++ b/extra/io/ports/ports-docs.factor @@ -23,11 +23,8 @@ $nl "Per-port native I/O protocol:" { $subsection init-handle } { $subsection (wait-to-read) } -"Additionally, the I/O backend must provide an implementation of the " { $link stream-flush } " and " { $link dispose } " generic words." -$nl -"Dummy ports which should be used to implement networking:" -{ $subsection server-port } -{ $subsection datagram-port } ; +{ $subsection (wait-to-write) } +"Additionally, the I/O backend must provide an implementation of the " { $link dispose } " generic word." ; ABOUT: "io.ports" diff --git a/extra/io/unix/sockets/secure/secure.factor b/extra/io/unix/sockets/secure/secure.factor index 675cd9a396..7e4e8955ae 100644 --- a/extra/io/unix/sockets/secure/secure.factor +++ b/extra/io/unix/sockets/secure/secure.factor @@ -73,6 +73,8 @@ M: ssl-handle drain M: ssl ((client)) ( addrspec -- handle ) [ addrspec>> ((client)) ] with-destructors ; +M: ssl parse-sockaddr addrspec>> parse-sockaddr ; + : check-connect-response ( port r -- event ) check-response { @@ -83,10 +85,13 @@ M: ssl ((client)) ( addrspec -- handle ) { SSL_ERROR_SSL [ (ssl-error) ] } } case ; -: do-ssl-connect ( port ssl -- ) +: do-ssl-connect ( port ssl addrspec -- ) + drop 2dup SSL_connect check-connect-response dup [ nip wait-for-port ] [ 3drop ] if ; M: ssl-handle (wait-to-connect) - [ file>> (wait-to-connect) ] - [ handle>> do-ssl-connect ] 2bi ; + addrspec>> + [ >r file>> r> (wait-to-connect) ] + [ >r handle>> r> do-ssl-connect ] + 3bi ;