Newer IO::Socket::SSL (tested 2.098 on FreeBSD) seems to trigger
undefined variable warnings on TLS negotiation failures and
other problems. Since I've been meaning to unify the {rbuf}
used by PublicInbox::DS with the {pi_io_rbuf} field anyways, it
seems best to bless these as PublicInbox::IO objects as early as
possible and avoid adding branches into in later stages.
I originally considered specialized changes to accept_tls_step
to stash the FD and ensure proper cleanup after IO::Socket::SSL
closes the socket behind our back, but it was too complex.
do {
if (my $addr = accept(my $c, $sock)) {
IO::Handle::blocking($c, 0); # no accept4 :<
+ # newer IO::Socket::SSL (tested 2.098) doesn't like
+ # unblessed sockets on TLS handshake failures;
+ # and plan to unify DS{rbuf} with {pi_io_rbuf}
+ bless $c, 'PublicInbox::IO';
eval { $self->{post_accept}->($c, $addr, $sock) };
warn "E: $@\n" if $@;
} elsif ($! == EAGAIN || $! == ECONNABORTED) {