# caller sets return value to $Epoll
sub _InitPoller () {
- if (PublicInbox::Syscall::epoll_defined()) {
+ if (defined $PublicInbox::Syscall::SYS_epoll_create) {
my $fd = epoll_create();
die "epoll_create: $!" if $fd < 0;
open($ep_io, '+<&=', $fd) or return;
- my $fl = fcntl($ep_io, F_GETFD, 0);
- fcntl($ep_io, F_SETFD, $fl | FD_CLOEXEC);
+ fcntl($ep_io, F_SETFD, FD_CLOEXEC);
$fd;
} else {
my $cls;
}
}
-sub zflush {} # overridden by DSdeflate
+sub dflush {} # overridden by DSdeflate
sub compressed {} # overridden by DSdeflate
sub long_response_done {} # overridden by Net::NNTP
if ($@ || !$self->{sock}) { # something bad happened...
delete $self->{long_cb};
my $elapsed = now() - $t0;
- $@ and $self->err("%s during long response[$fd] - %0.6f",
- $@, $elapsed);
+ $@ and warn("$@ during long response[$fd] - ",
+ sprintf('%0.6f', $elapsed),"\n");
$self->out(" deferred[$fd] aborted - %0.6f", $elapsed);
$self->close;
} elsif ($more) { # $self->{wbuf}:
my ($self) = @_;
# COMPRESS users all share the same DEFLATE context.
# Flush it here to ensure clients don't see each other's data
- $self->zflush;
+ $self->dflush;
# no recursion, schedule another call ASAP,
# but only after all pending writes are done.
# autovivify wbuf. wbuf may be populated by $cb,
# no need to rearm if so: (push returns new size of array)
- requeue($self) if push(@{$self->{wbuf}}, \&long_step) == 1;
+ $self->requeue if push(@{$self->{wbuf}}, \&long_step) == 1;
}
sub long_response ($$;@) {