From: Eric Wong Date: Thu, 24 Sep 2015 03:37:20 +0000 (+0000) Subject: nntpd: better encapsulation for shutdown X-Git-Tag: v1.0.0~836 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e3f00c42863737e588218fe904aed54449d4cf23;p=public-inbox.git nntpd: better encapsulation for shutdown We can use the UNIVERSAL::can to better encapsulate the shutdown process, in case we need to implement a gopher or HTTP daemon. --- diff --git a/public-inbox-nntpd b/public-inbox-nntpd index 70bab46f..9fb69cec 100644 --- a/public-inbox-nntpd +++ b/public-inbox-nntpd @@ -204,8 +204,7 @@ sub worker_quit { my $n = 0; foreach my $s (values %$dmap) { - next unless ref($s) eq 'PublicInbox::NNTP'; - if ($s->busy) { + if ($s->can('busy') && $s->busy) { ++$n; } else { $s->close;