-# Copyright (C) 2015-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Used by -nntpd for listen sockets
use base 'PublicInbox::DS';
use Socket qw(SOL_SOCKET SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY);
use fields qw(post_accept);
-require IO::Handle;
+use IO::Handle;
use PublicInbox::Syscall qw(EPOLLIN EPOLLEXCLUSIVE EPOLLET);
use Errno qw(EAGAIN ECONNABORTED EPERM);
# on high-traffic sites.
if (my $addr = accept(my $c, $sock)) {
IO::Handle::blocking($c, 0); # no accept4 :<
- $self->{post_accept}->($c, $addr, $sock);
+ eval { $self->{post_accept}->($c, $addr, $sock) };
+ warn "E: $@\n" if $@;
$self->requeue;
} elsif ($! == EAGAIN || $! == ECONNABORTED || $! == EPERM) {
# EAGAIN is common and likely