Fix a number of duh's in new code
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@446 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
bc3f52a380
commit
be6b0e203c
@ -116,7 +116,7 @@ sub AddTimer {
|
||||
my ($secs, $coderef) = @_;
|
||||
my $timeout = time + $secs;
|
||||
|
||||
if (!@Timers || ($timeout > $Timers[-1][0])) {
|
||||
if (!@Timers || ($timeout >= $Timers[-1][0])) {
|
||||
push @Timers, [$timeout, $coderef];
|
||||
return;
|
||||
}
|
||||
@ -275,9 +275,18 @@ sub EpollEventLoop {
|
||||
|
||||
my @events;
|
||||
my $i;
|
||||
my $evcount;
|
||||
# get up to 1000 events, 1000ms timeout
|
||||
while ($evcount = epoll_wait($Epoll, 1000, $timeout * 1000, \@events)) {
|
||||
my $evcount = epoll_wait($Epoll, 1000, $timeout * 1000, \@events);
|
||||
|
||||
if (!$evcount) {
|
||||
foreach my $fd ( keys %DescriptorMap ) {
|
||||
my Danga::Socket $sock = $DescriptorMap{$fd};
|
||||
if ($sock->can('ticker')) {
|
||||
$sock->ticker;
|
||||
}
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
my @objs;
|
||||
EVENT:
|
||||
for ($i=0; $i<$evcount; $i++) {
|
||||
@ -315,19 +324,6 @@ sub EpollEventLoop {
|
||||
}
|
||||
|
||||
return unless PostEventLoop();
|
||||
|
||||
}
|
||||
|
||||
foreach my $fd ( keys %DescriptorMap ) {
|
||||
my Danga::Socket $sock = $DescriptorMap{$fd};
|
||||
if ($sock->can('ticker')) {
|
||||
$sock->ticker;
|
||||
}
|
||||
}
|
||||
|
||||
return unless PostEventLoop();
|
||||
|
||||
print STDERR "Event loop ending; restarting.\n";
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user