From b3e4b3b3c67b9df7868518978e721417b0aa7c9c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 24 Jun 2019 02:52:41 +0000 Subject: ds|nntp: use CORE::close on socket 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). --- lib/PublicInbox/DS.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/DS.pm') diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 044b991c..2c886b4e 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -293,8 +293,8 @@ sub PostEventLoop { while (my $sock = shift @ToClose) { my $fd = fileno($sock); - # close the socket. (not a PublicInbox::DS close) - $sock->close; + # close the socket. (not a PublicInbox::DS close) + CORE::close($sock); # and now we can finally remove the fd from the map. see # comment above in ->close. -- cgit v1.2.3-24-ge0c7