about summary refs log tree commit homepage
path: root/lib/PublicInbox/TLS.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-10-30 02:13:58 +0000
committerEric Wong <e@80x24.org>2020-12-26 19:37:46 +0000
commit31f9b61a318f4daf8a6208ed4f6bc60aa355faa9 (patch)
tree891022802a7afad41c48811727c8b341a5431c4c /lib/PublicInbox/TLS.pm
parent5efbbd5e3e45ff3a4e49663c6741e176e604bbfc (diff)
downloadpublic-inbox-31f9b61a318f4daf8a6208ed4f6bc60aa355faa9.tar.gz
Apparently they happen (triggered by my -imapd instance), so
bail out by closing the underlying socket rather than stopping
the event loop and daemon process.

(cherry picked from commit c51c22c349529d9c377160abcc7961a6ca7b7d5c)
Diffstat (limited to 'lib/PublicInbox/TLS.pm')
-rw-r--r--lib/PublicInbox/TLS.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/TLS.pm b/lib/PublicInbox/TLS.pm
index 0f838e25..86e6331d 100644
--- a/lib/PublicInbox/TLS.pm
+++ b/lib/PublicInbox/TLS.pm
@@ -6,6 +6,7 @@ package PublicInbox::TLS;
 use strict;
 use IO::Socket::SSL;
 use PublicInbox::Syscall qw(EPOLLIN EPOLLOUT);
+use Carp qw(carp);
 
 sub err () { $SSL_ERROR }
 
@@ -13,7 +14,8 @@ sub err () { $SSL_ERROR }
 sub epollbit () {
         return EPOLLIN if $SSL_ERROR == SSL_WANT_READ;
         return EPOLLOUT if $SSL_ERROR == SSL_WANT_WRITE;
-        die "unexpected SSL error: $SSL_ERROR";
+        carp "unexpected SSL error: $SSL_ERROR";
+        undef;
 }
 
 1;