X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FDaemon.pm;h=505235864c0b22166841eb4c3b54c72f3e0abc29;hb=a1a8cbab22adec879f97dccd9acfd0c5b2492ba9;hp=0acd4ee9946c4d8f5dd29a25a6eddab0ef5f97c1;hpb=dd5a4f6497d4a5d94f61186a85516a56d7db8c29;p=public-inbox.git diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 0acd4ee9..50523586 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -6,8 +6,8 @@ # and/or lossy connections. package PublicInbox::Daemon; use strict; -use warnings; -use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/; +use v5.10.1; +use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev); use IO::Handle; # ->autoflush use IO::Socket; use POSIX qw(WNOHANG :signal_h); @@ -15,11 +15,12 @@ use Socket qw(IPPROTO_TCP SOL_SOCKET); STDOUT->autoflush(1); STDERR->autoflush(1); use PublicInbox::DS qw(now); -require PublicInbox::Listener; +use PublicInbox::Listener; use PublicInbox::EOFpipe; use PublicInbox::Sigfd; use PublicInbox::Git; use PublicInbox::GitAsyncCat; +use PublicInbox::Eml; our $SO_ACCEPTFILTER = 0x1000; my @CMD; my ($set_user, $oldset); @@ -270,13 +271,11 @@ sub worker_quit { # $_[0] = signal name or number (unused) my ($dmap, undef) = @_; my $n = 0; my $now = now(); - - foreach my $s (values %$dmap) { + for my $s (values %$dmap) { $s->can('busy') or next; - if ($s->busy($now)) { + if ($s->busy) { ++$n; - } else { - # close as much as possible, early as possible + } else { # close as much as possible, early as possible $s->close; } } @@ -642,6 +641,7 @@ sub run ($$$;$) { # localize GCF2C for tests: local $PublicInbox::GitAsyncCat::GCF2C; local $PublicInbox::Git::async_warn = 1; + local $SIG{__WARN__} = PublicInbox::Eml::warn_ignore_cb(); daemon_loop($refresh, $post_accept, $tlsd, $af_default); PublicInbox::DS->Reset;