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
openssl
openssl.libssl
;
IN:
io.sockets.secure.openssl
:
check-ssl-error
( ssl-handle ret -- event/f )
[
drop
]
[
[
handle>>
]
dip
SSL_get_error
]
2bi
{
{
SSL_ERROR_NONE
[
drop
f
]
}
{
SSL_ERROR_WANT_READ
[
drop
+input+
]
}
{
SSL_ERROR_WANT_WRITE
[
drop
+output+
]
}
{
SSL_ERROR_SYSCALL
[
ssl-error-syscall
]
}
{
SSL_ERROR_SSL
[
drop
throw-ssl-error
]
}
{
SSL_ERROR_ZERO_RETURN
[
drop
f
]
}
{
SSL_ERROR_WANT_ACCEPT
[
drop
+input+
]
}
}
case
;