diff options
author | Eric Wong <e@80x24.org> | 2019-06-24 02:52:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-24 05:26:27 +0000 |
commit | b3e4b3b3c67b9df7868518978e721417b0aa7c9c (patch) | |
tree | be6fe79456d577444fee29d3693e4e65f17c022b /lib/PublicInbox/NNTP.pm | |
parent | db4169098e955380c47689d26deeb75e6952eff3 (diff) | |
download | public-inbox-b3e4b3b3c67b9df7868518978e721417b0aa7c9c.tar.gz |
IO::Socket::SSL will try to re-bless back to the original class on TLS negotiation failure. Unfortunately, the original class is 'GLOB', and re-blessing to 'GLOB' takes away all the IO::Handle methods, because Filehandle/IO are a special case in Perl5. Anyways, since we already use syswrite() and sysread() as functions on our socket, we might as well use CORE::close(), as well (and it plays nicely with tied classes).
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 659e44d5..8840adbb 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -101,7 +101,7 @@ sub new ($$$) { my $ev = EPOLLOUT | EPOLLONESHOT; my $wbuf = []; if (ref($sock) eq 'IO::Socket::SSL' && !$sock->accept_SSL) { - $ev = PublicInbox::TLS::epollbit() or return $sock->close; + $ev = PublicInbox::TLS::epollbit() or return CORE::close($sock); $ev |= EPOLLONESHOT; $wbuf->[0] = \&PublicInbox::DS::accept_tls_step; } |