Handbook
Glossary
check-ssl-error ( ssl-handle ret -- event/f )
Vocabulary
io
.
sockets
.
secure
.
openssl
Inputs
ssl-handle
a
ssl-handle
ret
error code returned by an SSL function
Outputs
event/f
a symbol indicating the desired operation or
f
Word description
Checks if the last SSL function returned successfully or not. If so, returns
f
or a symbol,
+input+
or
+output+
, that indicates the socket operation required by libssl.
Definition
USING:
accessors
combinators
io.files
kernel
libc
openssl
openssl.libssl
;
IN:
io.sockets.secure.openssl
::
check-ssl-error
( ssl-handle ret -- event/f )
errno
:>
system-error ssl-handle
handle>>
ret
SSL_get_error
{
{
SSL_ERROR_NONE
[
f
]
}
{
SSL_ERROR_WANT_READ
[
+input+
]
}
{
SSL_ERROR_WANT_WRITE
[
+output+
]
}
{
SSL_ERROR_SYSCALL
[
ssl-handle ret system-error
(ssl-error-syscall)
]
}
{
SSL_ERROR_SSL
[
ssl-handle
f
>>connected
t
>>terminated
drop
throw-ssl-error
]
}
{
SSL_ERROR_ZERO_RETURN
[
f
]
}
{
SSL_ERROR_WANT_ACCEPT
[
+input+
]
}
{
SSL_ERROR_WANT_CONNECT
[
+output+
]
}
}
case
;