1 # Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # IO::Socket::SSL support code
5 package PublicInbox::TLS;
8 use PublicInbox::Syscall qw(EPOLLIN EPOLLOUT);
10 sub err () { $SSL_ERROR }
12 # returns the EPOLL event bit which matches the existing SSL error
14 return EPOLLIN if $SSL_ERROR == SSL_WANT_READ;
15 return EPOLLOUT if $SSL_ERROR == SSL_WANT_WRITE;
16 die "unexpected SSL error: $SSL_ERROR";